node-gyp rebuild - Error: `gyp` failed with exit code: 1
node-gyp rebuild - Error: `gyp` failed with exit code: 1
我在 CentOS 6.8 上重建 node-gyp 时遇到错误:
File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 295, in LoadBuildFileIncludesIntoDict
LoadOneBuildFile(include, data, aux_data, None, False, check),
File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 238, in LoadOneBuildFile
None)
File "/usr/local/app/jenkins/.node-gyp/iojs-1.4.0/common.gypi", line 1
{
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:355:16)
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 Linux 2.6.32-642.1.1.el6.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "rebuild" "--target=1.4.0" "--arch=x64" "--target_platform=linux" "--dist-url=https://atom.io/download/atom-shell" "--module_name=node_sqlite3" "--module_path=../lib/binding/electron-v1.4-linux-x64"
gyp ERR! cwd /usr/local/app/jenkins/workspace/offline/desktop/deploy/node_modules/sqlite3
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
尝试更新 node-gyp,全局安装 node-gyp。
已将 python 版本更新为 Python 2.7.6
问题已解决。
对于那些由于版本控制原因无法使用升级的 python 的用户,请尝试更改 cli。当 git bash 和命令提示符都失败时,Powershell 作为管理员工作。
我在 CentOS 6.8 上重建 node-gyp 时遇到错误:
File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 295, in LoadBuildFileIncludesIntoDict
LoadOneBuildFile(include, data, aux_data, None, False, check),
File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 238, in LoadOneBuildFile
None)
File "/usr/local/app/jenkins/.node-gyp/iojs-1.4.0/common.gypi", line 1
{
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:355:16)
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 Linux 2.6.32-642.1.1.el6.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "rebuild" "--target=1.4.0" "--arch=x64" "--target_platform=linux" "--dist-url=https://atom.io/download/atom-shell" "--module_name=node_sqlite3" "--module_path=../lib/binding/electron-v1.4-linux-x64"
gyp ERR! cwd /usr/local/app/jenkins/workspace/offline/desktop/deploy/node_modules/sqlite3
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
尝试更新 node-gyp,全局安装 node-gyp。
已将 python 版本更新为 Python 2.7.6
问题已解决。
对于那些由于版本控制原因无法使用升级的 python 的用户,请尝试更改 cli。当 git bash 和命令提示符都失败时,Powershell 作为管理员工作。