我使用Centos 6.6安裝在服務器上並嘗試使用node-gyp,但當我使用命令node-gyp build時,出現錯誤,我使用的python版本是2.7 .8和GCC C++編譯器。我得到的錯誤在下面提到。centos上的node-gyp構建錯誤
# node-gyp build
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/root/build'
make: *** No rule to make target `Release/obj.target/binding/src/binding.o',
needed by `Release/obj.target/binding.node'. Stop.
make: Leaving directory `/root/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/node-
gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit
(child_process.js:820:12)
gyp ERR! System Linux 2.6.32-504.3.3.el6.x86_64
gyp ERR! command "node" "/usr/local/bin/node-gyp" "build"
gyp ERR! cwd /root
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
你試過'node-gyp rebuild'嗎?這基本上和'node-gyp configure && node-gyp build'一樣。 – mscdex 2015-02-10 08:44:40
我得到以下錯誤make:進入目錄'/ root/build' make:***沒有規則來製作'Release/obj所需的'Release/obj.target/binding/src/binding.o'目標。目標/ binding.node」。停止。 make:離開目錄'/ root/build' – Sunil 2015-02-10 11:14:30
gyp ERR!建立錯誤 gyp ERR!堆棧錯誤:'make'失敗,退出代碼:2 gyp ERR!在ChildProcess.onExit上放置(/usr/local/lib/node_modules/node-gyp/lib/build.js:267:23) gyp ERR!堆棧在ChildProcess.emit(events.js:98:17) gyp ERR!堆棧在Process.ChildProcess._handle.onexit(child_process.js:820:12) gyp ERR!系統Linux 2.6.32-504.3.3.el6.x86_64 gyp ERR!命令「node」「/ usr/local/bin/node-gyp」「rebuild」 gyp ERR! cwd/root gyp ERR! node -v v0.10.35 gyp ERR! node-gyp -v v1.0.2 gyp ERR!不好 – Sunil 2015-02-10 11:15:07