5

I'm getting an error while doing node-gyp rebuild on CentOS 6.8:

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

Try with updating node-gyp, globally installing node-gyp.

Pang
  • 9,564
  • 146
  • 81
  • 122

3 Answers3

5

updated python version to Python 2.7.6

issue fixed.

  • how to install pythong 2.7.6 https://askubuntu.com/questions/682869/how-do-i-install-a-different-python-version-using-apt-get second answer and change the wget link to https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz – Shreyan Mehta May 26 '21 at 16:01
2

For those who can't use upgraded python for versioning reasons, try changing cli. Powershell as admin worked when git bash and command prompt both failed.

ulalu
  • 31
  • 1
  • 5
0

I was stuck with this issue for quite long on macOS. For me, on macOS, I had to

  1. Install Python 2.7.x while Python 3 was already installed
  2. Ensure Python 2 path was included in $PATH
  3. Switch CLI. It didn't work in iTerm2, but worked fine on standard macOS terminal

I did install xcode as well, but that didn't have an effect

Arghya C
  • 9,805
  • 2
  • 47
  • 66