目前,我正在尝试在我的计算机上安装CoffeeScript。我有node.js版本0.6.7和npm 1.1.0-beta-10。当我运行命令npm install -g coffee-script时,它会显示此错误。
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
我该如何解决这个问题?
答案 0 :(得分:5)
错误:EACCES,权限被拒绝'/ usr / local / lib / node_modules / ___ coffee-script.npm'
这意味着您没有访问权限,因此以root身份运行
$ sudo npm install -g coffee-script
(另外,奖励积分,不使用coffeescript(这是一件可怕的事情))
答案 1 :(得分:1)
permission denied
部分是您提示安装程序需要它没有的权限。尝试以root身份运行,即
sudo npm install coffee-script