我正在尝试安装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
答案 0 :(得分:1)
听起来很奇怪,GitHub页面的答案帮助我解决了这个问题:
然后从我的项目中删除原始node_modules文件夹 删除.node-gyp(我没有.npmrc),重启和安装 我的项目中的节点(sudo npm install)再次使用no 错误。