Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 未使用针对alpine linux的预构建节点sass_Node.js_Yarnpkg_Node Sass - Fatal编程技术网

Node.js 未使用针对alpine linux的预构建节点sass

Node.js 未使用针对alpine linux的预构建节点sass,node.js,yarnpkg,node-sass,Node.js,Yarnpkg,Node Sass,据我所知,node sass软件包有一个预构建的用于Alpine Linux的二进制文件,如上所述,但出于某种原因,当我运行warn 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 pac

据我所知,
node sass
软件包有一个预构建的用于Alpine Linux的二进制文件,如上所述,但出于某种原因,当我运行
warn 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可能已对其进行了升级

它寻找python是否是通过在安装中检入PATH变量安装的。它寻找python是因为它试图编译它,但我不明白为什么首先需要编译。您要安装什么版本?节点9仅受4.8支持。3@nschonni我使用节点8.11,上面的日志中显示了9.11.1。可能您正在运行NVM或另一个正在更改节点版本的版本切换程序