0

我正在尝试在全球范围内安装 contextify。

npm install -g contextify

系统详情:

  • 节点版本 - 5.2.0
  • NPM 版本 - 3.5.2
  • 系统 - CentOS 6.7 版(最终版)

尝试安装 contextify 时出现错误:

make: *** [Release/obj.target/contextify/src/contextify.o] Error 1
make: Leaving directory `/d0/home/dosi/.nvm/versions/node/v5.2.0/lib/node_modules/contextify/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/d0/home/dosi/.nvm/versions/node/v5.2.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:88:13)
gyp ERR! stack     at ChildProcess.emit (events.js:173:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:201:12)
gyp ERR! System Linux 2.6.32-573.7.1.el6.x86_64
gyp ERR! command "/d0/home/dosi/.nvm/versions/node/v5.2.0/bin/node" "/d0/home/dosi/.nvm/versions/node/v5.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /d0/home/dosi/.nvm/versions/node/v5.2.0/lib/node_modules/contextify
gyp ERR! node -v v5.2.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm ERR! Linux 2.6.32-573.7.1.el6.x86_64
npm ERR! argv "/d0/home/dosi/.nvm/versions/node/v5.2.0/bin/node" "/home/dosi/.nvm/versions/node/v5.2.0/bin/npm" "install" "-g" "contextify"
npm ERR! node v5.2.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! contextify@0.1.15 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify@0.1.15 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR!     npm bugs contextify
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls contextify
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /d0/home/dosi/platform/npm-debug.log

我也试过 sudo npm install -g contextify

gyp ERR! configure error
gyp ERR! stack Error: EACCES, mkdir '/d0/home/dosi/.nvm/versions/node/v5.2.0/lib/node_modules/contextify/build'
gyp ERR! System Linux 2.6.32-573.7.1.el6.x86_64
gyp ERR! command "node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /d0/home/dosi/.nvm/versions/node/v5.2.0/lib/node_modules/contextify
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! Linux 2.6.32-573.7.1.el6.x86_64
npm ERR! argv "/d0/home/dosi/.nvm/versions/node/v5.2.0/bin/node" "/home/dosi/.nvm/versions/node/v5.2.0/bin/npm" "install" "-g" "contextify"
npm ERR! node v5.2.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! contextify@0.1.15 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify@0.1.15 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR!     npm bugs contextify
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls contextify
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /d0/home/dosi/npm-debug.log
4

2 回答 2

0

https://github.com/brianmcd/contextify

您不需要在节点上使用此模块 >= 0.12

从 Node 0.12 开始,Contextify 已合并到 Node 中(感谢 @domenic),取代了原生 vm 模块。从那时起,代码已经得到改进,所以如果可能的话,你应该使用更新的 Node 和原生的 vm 模块。请注意,较新版本的 JSDOM 不再依赖于 Contextify。

于 2015-12-24T11:12:26.883 回答
-3
sudo npm install -g node-inspector --unsafe-perm

解决了这个问题。

于 2016-01-03T20:03:50.137 回答