node-gyp rebuild - Error: `gyp` failed with exit code: 1

18,351

Solution 1

updated python version to Python 2.7.6

issue fixed.

Solution 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.

Share:
18,351
Chathuranga Abeyrathna
Author by

Chathuranga Abeyrathna

To become an industry expert in the field of Computer Systems, System Engineering with better utilization of my technical, management and leadership skills in a challenging environment where innovation and education are valued and encouraged. Also, a very good team player and have a very good ability to work getting done as a team and I have very special talent to make important decisions in a critical time with very good management Practice.

Updated on June 30, 2022

Comments

  • Chathuranga Abeyrathna
    Chathuranga Abeyrathna almost 2 years

    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.

  • Shreyan Mehta
    Shreyan Mehta almost 3 years
    how to install pythong 2.7.6 askubuntu.com/questions/682869/… second answer and change the wget link to python.org/ftp/python/2.7.6/Python-2.7.6.tgz
  • kingshuk basak
    kingshuk basak almost 3 years
    I was using iTerm that gave the issue. Switching to terminal fixed it.