javascript - 安装 Node 模块时出错---找不到common.gypi

标签 javascript node.js npm

当我运行 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 是什么以及为什么会发生错误。 谁能帮我解决这个问题?

最佳答案

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

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

关于javascript - 安装 Node 模块时出错---找不到common.gypi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18253143/

相关文章:

javascript - 设置默认 .aspx 页面访问?

javascript - 在 React 组件的渲染函数中返回 DOM 元素

javascript - 在 Canvas 元素上旋转 Sprite

node.js - everyauth 密码示例错误

node.js - 重启时Nodemon不执行命令

javascript - 如何将 2D 数组从 JavaScript 传递到 PHP

javascript - Node.js 异步系列无法按顺序工作

javascript - 使用 Passport 的 Node.js 用户身份验证

angular - 错误找不到模块'@angular/material

node.js - npm 命令不工作/响应