0

I am trying to installed contextify globally.

npm install -g contextify

System Details:

  • Node Version - 5.2.0
  • NPM Version - 3.5.2
  • System - CentOS release 6.7 (Final)

Error I get when trying to install 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

I also tried 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
yashdosi
  • 1,186
  • 1
  • 18
  • 40

2 Answers2

0

https://github.com/brianmcd/contextify

YOU DON'T NEED THIS MODULE ON NODE >= 0.12

As of Node 0.12, Contextify has been merged into Node (thanks to @domenic), replacing the native vm module. The code has been improved on since then, so if at all possible, you should use a newer Node and the native vm module. Note that newer versions of JSDOM no longer depend on Contextify.

Nazar Sakharenko
  • 1,007
  • 6
  • 11
  • 1
    But I still need that.. because I am not writing new code.. I am trying to build an existing code.. which depends on that package... – yashdosi Dec 24 '15 at 13:09
  • Then you should remove deps. or update contextify module to support latest node version. *contextify* use nan module, and they'r not suporting node v5 `A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10, 0.12 and 4.` – Nazar Sakharenko Dec 24 '15 at 13:24
  • I am more of a beginner in Node.js could you explain that in a bit more detail? :/ – yashdosi Dec 24 '15 at 13:28
  • 2
    *contextify* is a c++ extension. Since node use google v8 engine to execute Javascript code, and v8 version 3 (node.js 0.12) not compatible vs. v8 version 4 (node.js 5.0) you can't easily migrate from 0.12 to 5.0. I looked to package.json of `contextify`, and looks like it may work with node v4. So, you have 4 ways: 1. Try to install node v4, and run your application. 2. Update your js code, and get rid of `contextify` dependency 3. Update `contextify` module to support latest node version (c++ and v8 knowledge) 4. Continue to use node v0.10 - v0.12 – Nazar Sakharenko Dec 24 '15 at 13:51
-3
sudo npm install -g node-inspector --unsafe-perm

solved this problem.