1

Possible Duplicate:
error installing coffeescript on mac 10.7.2

At the moment, I am trying to install CoffeeScript on my computer. I have node.js version 0.6.7 and npm 1.1.0-beta-10. When i run the command npm install -g coffee-script, it shows this error.

npm http GET https://registry.npmjs.org/coffee-script
npm http 200 https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/coffee-script/-/coffee-script-1.2.0.tgz
npm http 200 https://registry.npmjs.org/coffee-script/-/coffee-script-1.2.0.tgz
npm ERR! Could not create /usr/local/lib/node_modules/___coffee-script.npm
npm ERR! error installing coffee-script@1.2.0
npm ERR! Error: EACCES, permission denied '/usr/local/lib/node_modules/___coffee-script.npm'
npm ERR! Report this *entire* log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>
npm ERR! 
npm ERR! System Darwin 11.0.1
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "coffee-script"
npm ERR! cwd /Users/Solomon
npm ERR! node -v v0.6.7
npm ERR! npm -v 1.1.0-beta-10
npm ERR! path /usr/local/lib/node_modules/___coffee-script.npm
npm ERR! code EACCES
npm ERR! message EACCES, permission denied '/usr/local/lib/node_modules/___coffee-script.npm'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/Solomon/npm-debug.log

How do I fix this?

Community
  • 1
  • 1
Billjk
  • 10,387
  • 23
  • 54
  • 73

2 Answers2

5

Error: EACCES, permission denied '/usr/local/lib/node_modules/___coffee-script.npm'

That means you dont have access, so run as root

$ sudo npm install -g coffee-script

(Bonus points for alternatively, not using coffeescript (it's a horrible thing))

Raynos
  • 166,823
  • 56
  • 351
  • 396
1

The permission denied part is your hint that the installer needs privileges that it doesn't have. Try running as root, i.e.

sudo npm install coffee-script
Aaron Dufour
  • 17,288
  • 1
  • 47
  • 69