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

时间:2016-05-21 11:05:25

标签: javascript node.js npm

我正在尝试安装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

1 个答案:

答案 0 :(得分:1)

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

  

然后从我的项目中删除原始node_modules文件夹   删除.node-gyp(我没有.npmrc),重启和安装   我的项目中的节点(sudo npm install)再次使用no   错误。