【问题标题】:npm install jquery fails on node-gyp rebuildnpm install jquery 在 node-gyp 重建时失败
【发布时间】:2012-08-20 10:49:42
【问题描述】:

我似乎无法在最新版本的 npm/node 上安装 jquery。这是堆栈跟踪:

npm http GET https://registry.npmjs.org/jquery
npm http 304 https://registry.npmjs.org/jquery
npm http GET https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/htmlparser/1.7.6
npm http GET https://registry.npmjs.org/xmlhttprequest
npm http GET https://registry.npmjs.org/location/0.0.1
npm http GET https://registry.npmjs.org/navigator
npm http 304 https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/xmlhttprequest
npm http 304 https://registry.npmjs.org/location/0.0.1
npm http 304 https://registry.npmjs.org/htmlparser/1.7.6
npm http 304 https://registry.npmjs.org/navigator
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings

> contextify@0.1.3 install /root/node_modules/jquery/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack     at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:68:16)
gyp ERR! stack     at Object.commands.forEach.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:56:37)
gyp ERR! stack     at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:185:20)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:105:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:534:7)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack     at maybeClose (child_process.js:634:16)
gyp ERR! stack     at Socket.ChildProcess.spawn.stdin (child_process.js:806:11)
gyp ERR! stack     at Socket.EventEmitter.emit (events.js:88:17)
gyp ERR! stack     at Socket._destroy.destroyed (net.js:356:10)
gyp ERR! System Linux 2.6.32-24-server
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node_modules/jquery/node_modules/jsdom/node_modules/contextify
gyp ERR! node -v v0.9.1-pre
gyp ERR! node-gyp -v v0.6.5
gyp ERR! not ok 
npm WARN optional dep failed, continuing contextify@0.1.3

【问题讨论】:

    标签: jquery node.js npm


    【解决方案1】:

    我似乎无法在最新版本的 npm/node 上安装 jquery。

    Node.JS 的最新版本是v0.8.8 (stable)(release notes、download)和v0.9.0 (unstable)。

    您当前正在运行的是 v0.9.1-pre——从正在完成的工作到 v0.9.1 版本的开发构建。

    这就是问题所在:

    错误:无法安装“pre”版本的节点

    您尝试安装的模块不支持在开发版本上运行。所以,你必须决定一个发布版本来试用它们。

    您可能还想记下 Node.JS 使用的 versioning scheme。

    【讨论】:

    • 奇怪我在尝试在节点 0.8.6 stable 上安装 jquery 时遇到了 gyp 的问题? gyp ERR! stack Error: not found: make…gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)
    • 嗯,刚刚用节点 0.8.8 进行了全新安装,现在工作正常……一定是某种冲突:)
    • 奇怪...我确信我在 0.8.x 上。谢谢!
    猜你喜欢
    • 2015-03-28
    • 2019-04-05
    • 1970-01-01
    • 2020-09-11
    • 2022-01-16
    • 1970-01-01
    • 2016-05-19
    • 2014-12-04
    • 2018-11-29
    相关资源
    最近更新 更多