19

I am trying to "node-gyp configure" to try to get the ms sql server driver. However, initially it said binding.gypi was missing or something to that effect. Now however it is saying common.gypi not found. So I created a text document relabelled it as common.gypi and pasted the code from the file common.gypi that I found in the github repository into the file and saved it and closed it and ran "node-gyp configure". This is the output.

D:\Node\SQLServerConnector\node-sqlserver-master>node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@0.10.6
gyp info using node@0.10.15 | win32 | ia32
gyp info spawn python
gyp info spawn args [ 'C:\Users\Suresh\AppData\Roaming\npm\node_modules\n
ode-gyp\gyp\gyp',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=auto',
gyp info spawn args '-I',
gyp info spawn args 'D:\Node\SQLServerConnector\node-sqlserver-master\buil
d\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'D:\Node\SQLServerConnector\node-sqlserver-master\comm
on.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\Suresh\AppData\Roaming\npm\node_modules\n
ode-gyp\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\Suresh\.node-gyp\0.10.15\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\Users\Suresh\.node-gyp\0.10.15',
gyp info spawn args '-Dmodule_root_dir=D:\Node\SQLServerConnector\node-sqls
erver-master',
gyp info spawn args '--depth=.',
gyp info spawn args '--generator-output',
gyp info spawn args 'D:\Node\SQLServerConnector\node-sqlserver-master\buil
d',
gyp info spawn args '-Goutput_dir=.' ]
gyp: C:\Users\Suresh.node-gyp\0.10.15\common.gypi not found (cwd: D:\Node\SQLSe
rverConnector\node-sqlserver-master) while reading includes of binding.gyp while
trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\Suresh\AppData\Roaming\npm
\node_modules\node-gyp\lib\configure.js:424:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:
12)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "node" "C:\Users\Suresh\AppData\Roaming\npm\node_modules\
\node-gyp\bin\node-gyp.js" "configure"
gyp ERR! cwd D:\Node\SQLServerConnector\node-sqlserver-master
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok

Please help me resolve this error.

3 Answers3

26

I've had luck with:

rm -rf ~/.node_gyp cd myAwesomeProject npm install npm rebuild

when switching between node 4 and 0.12.4

stevethecollier
  • 954
  • 9
  • 13
  • 3
    I have been looking for a solid, straightforward answer to this issue forever and somehow only now found your post. I use nvm and I'm guessing different versions of node all use that node-gyp folder and things get corrupted over time. There were some global modules I thought were simply incompatible with node 4 but simply deleting the node-gyp folder solved it :) Cheers! – sunny-mittal Sep 30 '15 at 00:19
  • 1
    Thank you @Jedininjaster - you saved my day – szydan May 20 '16 at 17:00
6

Seems to be a common issue these days.

You can check https://github.com/TooTallNate/node-gyp/issues/313 and https://github.com/TooTallNate/node-gyp/issues/376 to see if any of these solutions solve your issue.

Particularly, you can:

  • Remove old dir ~/.node_gyp and run npm install

  • Copy an older version (ex: ~/.node-gyp/0.10.11/) to the complying path.

  • Copy the latest version to the complying path.

  • Chime in this thread to get help.

Diosney
  • 10,287
  • 15
  • 64
  • 109
0

My solution (on windows) was to go to %appdata%/npm-gypi and delete the folder, after that I could install ganache (which I guess uses gypi as a dependency).

I sure hope this helps someone.. it has been 3 hours of troubleshooting for me..

Edit: Oh and I deleted the npm-cache too

Daniel Bernal
  • 174
  • 2
  • 6