繁体   English   中英

node-gyp重建错误。 为什么?

[英]node-gyp rebuild error. Why?

我正在尝试安装summarizer模块。 输出结果如下:

npm i summarizer
npm WARN deprecated lodash-node@3.10.2: This package has been discontinued in favor of lodash@^4.0.0.

> http-sync@0.0.5 install /home/me/node-workspace/node_modules/http-sync
> node-gyp rebuild

make: Entering directory '/home/me/node-workspace/node_modules/http-sync/build'
  CXX(target) Release/obj.target/curllib/curllib.o
../curllib.cc:26:28: error: expected class-name before ‘{’ token
 class CurlLib : ObjectWrap {                            ^
.
.
.

是什么导致这些错误?

我尝试了什么?
删除$HOME/.node-gyp没有帮助。
参考: https : //github.com/nodejs/node-gyp/issues/809

听起来很奇怪,但GitHub页面上的答案帮助我解决了这个问题:

从我的项目中删除原始的node_modules文件夹,然后删除.node-gyp(我没有.npmrc),重新启动,然后使用(sudo npm install)重新在我的项目中安装node都没有错误。

暂无
暂无

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

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