问题
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.
回答1:
I've had luck with:
rm -rf ~/.node_gyp
cd myAwesomeProject
npm install
npm rebuild
when switching between node 4 and 0.12.4
回答2:
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.
来源:https://stackoverflow.com/questions/17967546/common-gypi-not-found-error-in-node-js