[英]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.