1

I am having trouble installing keystone.js on Linux. Not really sure exactly what the problem is as I am very new to Linux. Here's the output below when I try to install keystone using npm install -g generator-keystone

I solved some issues with the answers from this: npm throws error without sudo but still getting these errors:

npm ERR! Error: EACCES, symlink '../lib/node_modules/yo/cli.js'
npm ERR!  { [Error: EACCES, symlink '../lib/node_modules/yo/cli.js']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '../lib/node_modules/yo/cli.js' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "generator-keystone"
npm ERR! cwd /home/emile
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path ../lib/node_modules/yo/cli.js
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, symlink '../lib/node_modules/yo/cli.js'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/emile/npm-debug.log
npm ERR! not ok code 0

Any ideas?

Thanks

antzshrek
  • 9,276
  • 5
  • 26
  • 43
Emile Paffard-Wray
  • 1,006
  • 2
  • 9
  • 17

2 Answers2

1

This link solved this exact issue for me: https://groups.google.com/forum/#!topic/keystonejs/zZdSoz_sIn0

In short, the following spell solved the issue for me:

root@localhost:~# which nodejs
/usr/bin/nodejs
root@localhost:~# cd /usr/bin/
root@localhost:/usr/bin# ln -s nodejs node
John Dunne
  • 387
  • 1
  • 6
  • 12
0

Run it with sudo.

The line

Error: EACCES, mkdir '/usr/local/lib/node_modules'

Means NPM does not have sufficient permissions to create a new directory

The error log itself is telling you what to do.

Please try running this command again as root/Administrator.
Alex Hill
  • 713
  • 1
  • 5
  • 13
  • That's a bandaid. You *shouldn't* be using sudo to install npm global modules. See http://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo – Harry Moreno Oct 21 '14 at 22:13
  • Thanks, that worked great right until the end, now I'm getting this: npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian npm ERR! weird error 127 npm ERR! not ok code 0 – Emile Paffard-Wray Oct 21 '14 at 22:14
  • The npm warning is usually due to installing node from just doing "sudo apt-get install node" which installs an out of date version. You need to purge node/npm from your system, then I would reccomend using [NVM](https://github.com/creationix/nvm), or just add the node PPA: sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install node – Alex Hill Oct 21 '14 at 22:19
  • Thanks, but still getting some errors, made some edits to the question – Emile Paffard-Wray Oct 21 '14 at 22:41