node.js - Nodes.js installation on ec2 : no symlink created -


i have problems launch node , npm after compiling them source.
have installed node on aws ec2, micro instance, virtualmin ami based on redhat.
since it’s micro instance, took 2 hours compile ...

here how installed :

wget -n http://nodejs.org/dist/node-latest.tar.gz tar xzvf node-latest.tar.gz cd node-latest make make install 

after that, typing node -v did nothing. command not found. nothing npm -v too.

im not comfortable linux understand no symlink have been created node , npm. aren’t supposed created automatically ?

for node can :

ln -s /usr/local/src/node-v0.10.5/out/release/node /usr/bin/node 

and node -v gives me expected : v0.10.5

then doing same npm

ln -s /usr/local/src/node-v0.10.5/deps/npm/bin/npm /usr/bin/npm 

but trying npm -v doesn’t work :

module.js:340     throw err;           ^ error: cannot find module '/usr/bin/node_modules/npm/bin/npm-cli.js'     @ function.module._resolvefilename (module.js:338:15)     @ function.module._load (module.js:280:25)     @ function.module.runmain (module.js:497:10)     @ startup (node.js:119:16)     @ node.js:901:3 

it seems thats searching files in /usr/bin/ directory, files in /usr/local/src/node-v0.10.5/deps/npm/ directory.

what doing wrong ?

use this

sudo ln -s /usr/local/bin/node /usr/bin/node sudo ln -s /usr/local/lib/node /usr/lib/node sudo ln -s /usr/local/bin/npm /usr/bin/npm sudo ln -s /usr/local/bin/node-waf /usr/bin/node-waf 

but should not take 2 hours! launch ec2 ubuntu 12.04 lts instance node through cloudinit , userdata in several minutes.

you can script instead:

add-apt-repository ppa:chris-lea/node.js apt-get update apt-get install -y nodejs npm install npm -g 

Comments