1

I am trying to install npm on the amazon ec2 instance.

I already installed git and node.js in my instance

What I typed was these

git clone git://github.com/joyent/node.git
cd node
git checkout v0.10.20
./configure
make
sudo make install
git clone https://github.com/isaacs/npm.git
cd npm
sudo make install

But will end up with this error

rm -rf \
    .building_ronn \
    html/doc \
    html/api \
    man
scripts/doc-build.sh doc/api/npm-test.md man/man3/npm-test.3
make[1]: Entering directory `/home/ec2-user/npm'
node cli.js install ronn --no-global
bash: node: command not found
make[1]: *** [node_modules/.bin/ronn] Error 127
make[1]: Leaving directory `/home/ec2-user/npm'
make: *** [man/man3/npm-test.3] Error 2
kkh
  • 4,799
  • 13
  • 45
  • 73
  • why are you installing npm? It is bundled with node.js – vinayr Feb 10 '14 at 05:45
  • Also, if you use `&&` between configure, make, and make install, you can be certain that one will complete successfully before the next process starts. It appears that either building Node.js was unsuccessful, or its install location is not on your $PATH. – Ryan Parman Feb 10 '14 at 06:20

1 Answers1

0

This question's progression of commands are in reference to How to install & setup Node.js on Amazon EC2 which was written in 2012 and doesn't acknowledge that npm now comes bundled with node.js. You can type which npm to see that it's already installed and then safely rm -rf npm/ the vestigial npm folder.

(If using sudo npm results in command not found, you may need to set up symlinks like so: https://stackoverflow.com/questions/4976658/on-ec2-sudo-node-command-not-found-but-node-without-sudo-is-ok/5062718#5062718)

Community
  • 1
  • 1
lydiat
  • 369
  • 2
  • 6