简体   繁体   English

在 node-expat@2.3.17 安装脚本失败 - 任何 NPM 安装都会发生

[英]Failed at the node-expat@2.3.17 install script - Happens with any NPM installation

Any npm package I try to install or even just npm install itself will it give me the following error.我尝试安装的任何 npm 包,甚至只是 npm install 本身都会给我以下错误。

fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [Release/obj.target/node_expat/node-expat.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/myname/.npm-global/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:257:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/Users/myname/.npm-global/lib/node_modules/node/bin/node" "/Users/name/.npm-global/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/myname/Desktop/Portfolio/portfolio/node_modules/node-expat
gyp ERR! node -v v12.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-expat@2.3.17 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.3.17 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I've already tried removing my node-gyp file in my home directory, deleting my node_modules folder from my project and json lock file.我已经尝试在我的主目录中删除我的 node-gyp 文件,从我的项目和 json 锁定文件中删除我的 node_modules 文件夹。 I've also tried uninstalling npm and re-installing it as well as restarting my mac.我还尝试卸载 npm 并重新安装它以及重新启动我的 mac。

You can see pull request at here: https://github.com/astro/node-expat/pull/196 .您可以在此处查看拉取请求: https ://github.com/astro/node-expat/pull/196。 I think you are using Node 12. You can downgrade Node version to 10 or 8. Some warning can occur but you can install node-expat success.我认为您使用的是 Node 12。您可以将 Node 版本降级到 10 或 8。可能会出现一些警告,但您可以安装 node-expat 成功。 May be it useful for you.可能对你有用。

SOLVED解决了

Install this:安装这个:

sudo apt-get install gcc g++ make

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

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