安装Node.js模块时出现错误---common.gypi未找到。

4
当我运行npm install时,应该安装package.json中包含的node模块,但是出现以下错误:
npm http 304 https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options
gyp: C:\Documents and Settings\Jicheng An\.node-gyp\0.10.5\common.gypi not found (cwd: c:\Documents and Settings\Jicheng An\csfv_cms_module\node_modules\csfv_misc_module\node_modules\email-templates\node_modules\juice\node_modules\jsdom\node_modules\contextify) 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 (h:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:415:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Windows_NT 5.1.2600
gyp ERR! command "node" "h:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Documents and Settings\Jicheng An\csfv_cms_module\node_modules\csfv_misc_module\node_modules\email-templates\node_modules\juice\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.10.5
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok 
npm http 304 https://registry.npmjs.org/tinycolor
npm http 304 https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/commander
npm ERR! Error: ENOENT, lstat 'c:\Documents and Settings\Jicheng An\csfv_cms_module\node_modules\csfv_misc_module\node_modules\email-templates\node_modules\juice\node_modules\jsdom\node_modules\cssstyle\lib\properties\borderBottomWidth.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Windows_NT 5.1.2600
npm ERR! command "h:\\Program Files\\nodejs\\node.exe" "h:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
npm ERR! cwd c:\Documents and Settings\Jicheng An\csfv_cms_module
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! path c:\Documents and Settings\Jicheng An\csfv_cms_module\node_modules\csfv_misc_module\node_modules\email-templates\node_modules\juice\node_modules\jsdom\node_modules\cssstyle\lib\properties\borderBottomWidth.js
npm ERR! fstream_path c:\Documents and Settings\Jicheng An\csfv_cms_module\node_modules\csfv_misc_module\node_modules\email-templates\node_modules\juice\node_modules\jsdom\node_modules\cssstyle\lib\properties\borderBottomWidth.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack h:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! contextify@0.1.6 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the contextify@0.1.6 install script.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls contextify
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 5.1.2600
npm ERR! command "h:\\Program Files\\nodejs\\node.exe" "h:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
npm ERR! cwd c:\Documents and Settings\Jicheng An\csfv_cms_module
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm WARN engine mong.socket.io@0.9.0: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.5","npm":"1.2.18"})
npm http GET https://registry.npmjs.org/passport-openid
npm http GET https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/passport-oauth
npm http GET https://registry.npmjs.org/passport-oauth

我不知道common.gypi是什么,以及为什么会出现错误。有人能帮我解决这个问题吗?

1个回答

0

我相信你的模块需要编译,npm中的大多数模块都有为Win Mac Linux预编译的二进制文件,但这个模块需要使用node-gyp进行编译。https://github.com/TooTallNate/node-gyp

对于Windows,它实际上会为模块的C源文件创建.sln和.cxproj文件。并且它将使用Python来完成此操作。之后,它将运行msbuild来构建解决方案。在这种情况下,您至少需要Visual Studio Express。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接