未使用 alpine linux 的预构建节点-sass

Prebuilt node-sass for alpine linux not used

据我所知,node-sass 软件包有一个用于 Alpine Linux 的预构建二进制文件,如 releases page 所述,但出于某种原因,当我 运行 yarn install 它尝试从源代码编译它。

这可能是什么原因?这是纱线错误吗?

yarn install v1.5.1
warning package.json: No license field
warning emulsify@1.0.0: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.1.2: The platform "linux" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error An unexpected error occurred: "/var/www/html/node_modules/node-sass: Command failed.
Exit code: 1
Command: sh
Arguments: -c node scripts/build.js
Directory: /var/www/html/node_modules/node-sass
Output:
Building: /usr/local/bin/node /var/www/html/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli   '/var/www/html/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@9.11.1 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing \"build\" directory
gyp verb command configure []
gyp verb check python checking for Python executable \"python2\" in the PATH
gyp verb `which` failed Error: not found: python2

我发布了答案,因为隐藏的评论对大多数人来说不够好:

卸载NPM并重新安装v8.11,nvm可能已经升级了。