简体   繁体   English

吉普错误! npm 安装

[英]gyp ERR! npm install

is there any soluation for this error?这个错误有什么解决办法吗? I'm receiving that while running npm install on centos 7. npm version = 8.5.0 nodejs version = v16.14.1我在运行 npm 安装时收到了 centos 7. npm 版本 = 8.5.0 nodejs 版本 = v16.14.1

receiving error: screenshot接收错误:截图

npm ERR! path /usr/share/nginx/html/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/bin/node /usr/share/nginx/html/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   '/usr/bin/node',
npm ERR! gyp verb cli   '/usr/share/nginx/html/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.14.1 | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "/usr/bin/python3" in the PATH
npm ERR! gyp verb `which` failed Error: not found: /usr/bin/python3
npm ERR! gyp verb `which` failed     at /usr/share/nginx/html/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed     at /usr/share/nginx/html/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed  /usr/bin/python3 Error: not found: /usr/bin/python3
npm ERR! gyp verb `which` failed     at getNotFoundError (/usr/share/nginx/html/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed     at F (/usr/share/nginx/html/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed     at /usr/share/nginx/html/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Can't find Python executable "/usr/bin/python3", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack     at E (/usr/share/nginx/html/node_modules/which/which.js:80:29)
npm ERR! gyp ERR! System Linux 3.10.0-1160.45.1.el7.x86_64
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/share/nginx/html/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /usr/share/nginx/html/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.14.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok 
npm ERR! Build failed with error code: 1

It appears that you have a Node module that depends on Python. As you're on CentOS you'll need to run:看起来你有一个依赖于 Python 的节点模块。当你在 CentOS 上时,你需要运行:

sudo yum update
sudo yum install python3

then run然后运行

python3 -V

to verify that Python is installed.验证是否安装了 Python。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM