Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nodeenv hangs when setting up a new environment

Tags:

node.js

I tried using nodeenv in the following way:

$ virtualenv --python=python2.7 venv
$ source venv/bin/activate
(venv) $ pip2.7 install nodeenv
(venv) $ nodeenv --node=0.12.2 nenv

But it hangs on:

 * Install node (0.12.2)..

I am not sure how to investigate this issue. Thoughts? Do I need to install Node before all that (currently, $ node \ -sh: node: command not found)? I was under the impression that the correct version of Node would be installed by nodeenv.

like image 550
gduverger Avatar asked Apr 08 '15 20:04

gduverger


1 Answers

It is probably not hanged, but just slow. nodeenv runs a C++ compiler (presumably to compile v8). For that reason, creating a nodeenv environment takes several minutes on my computer. To avoid that you can use the --prebuilt switch to download a prebuilt node.js rather than compiling from source:

nodeenv --prebuilt nenv

If you do opt to compile, you can watch it do its work by running nodeenv and then, while that's still going, running a command like this:

watch 'ps auxfwww | grep -A4 make'
like image 184
Croad Langshan Avatar answered Oct 16 '22 04:10

Croad Langshan