簡體   English   中英

npm安裝失敗,並出現node-gyp構建錯誤

[英]npm install fails with node-gyp build error

今天,當我運行npm install ,它失敗並顯示以下錯誤日志。 我知道這是哈希表的問題,但我以前從未遇到過此問題。

> hashtable@2.0.2 install /Users/admin/myproject/node_modules/hashtable
> node-gyp configure build

  CXX(target) Release/obj.target/native/src/hashtable.o
  SOLINK_MODULE(target) Release/native.node
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/native.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/admin/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.5.0
gyp ERR! command "/usr/local/bin/node" "/Users/admin/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /Users/admin/myproject/node_modules/hashtable
gyp ERR! node -v v4.4.7
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
myproject@0.0.1 /Users/admin/myproject
└── (empty)

npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/Users/admin/.npm-packages/bin/npm" "install"
npm ERR! node v4.4.7
npm ERR! npm  v3.10.5
npm ERR! code ELIFECYCLE

npm ERR! hashtable@2.0.2 install: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the hashtable@2.0.2 install script 'node-gyp configure build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hashtable package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp configure build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs hashtable
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls hashtable
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/admin/myproject/npm-debug.log
npm ERR! code 1

我以為node-gyp可能有問題,所以我做了一個npm install node-gyp -g單獨npm install node-gyp -g但問題沒有消失。 有誰知道如何解決這個問題?

順便說一句,我在Mac上運行OSX 10.11.5,最近還為一個單獨的項目安裝了XCode 6.3.2,並且只能使用此版本的XCode,不確定是否會導致此問題。

node-gyp還需要MacO上的python和xcode才能進行C ++編譯。 其他系統也有類似的要求。

你可以找到預請求數為節點GYP包的NPM頁這里

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM