在 Mac OS X Lion 上安装 npm@1.1.1 时出错
我正在尝试在 Mac OS X Lion 上使用 Express 框架。存在这些问题:
SilverFir-2:Node mike$ sudo curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7881 100 7881 0 0 29556 0 --:--:-- --:--:-- --:--:-- 43541
tar=/usr/bin/tar
version:
bsdtar 2.8.3 - libarchive 2.8.3
install [email protected]
fetching: http://registry.npmjs.org/npm/-/npm-1.1.1.tgz
0.6.1
1.1.1
cleanup prefix=/usr/local
All clean!
npm ERR! Could not create /usr/local/lib/node_modules/___npm.npm
npm ERR! error installing [email protected]
npm ERR! Error: EACCES, permission denied '/usr/local/lib/node_modules'
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR!
npm ERR! System Darwin 11.3.0
npm ERR! command "/usr/local/bin/node" "/private/var/folders/6x/frvx23td327frc2z_hgl12sc0000gn/T/npm.3230/package/cli.js" "install" "-gf"
npm ERR! cwd /private/var/folders/6x/frvx23td327frc2z_hgl12sc0000gn/T/npm.3230/package
npm ERR! node -v v0.6.1
npm ERR! npm -v 1.1.1
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! message EACCES, permission denied '/usr/local/lib/node_modules'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/6x/frvx23td327frc2z_hgl12sc0000gn/T/npm.3230/package/npm-debug.log
npm not ok
It failed
节点版本 v0.6.1。
我在网上查了一下,大多数答案都是从节点0.4天开始的,他们都只是说升级。看起来我比以前的问题更了解最新情况......
I am trying to get going with express framework on Mac OS X Lion. Having these issues:
SilverFir-2:Node mike$ sudo curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7881 100 7881 0 0 29556 0 --:--:-- --:--:-- --:--:-- 43541
tar=/usr/bin/tar
version:
bsdtar 2.8.3 - libarchive 2.8.3
install [email protected]
fetching: http://registry.npmjs.org/npm/-/npm-1.1.1.tgz
0.6.1
1.1.1
cleanup prefix=/usr/local
All clean!
npm ERR! Could not create /usr/local/lib/node_modules/___npm.npm
npm ERR! error installing [email protected]
npm ERR! Error: EACCES, permission denied '/usr/local/lib/node_modules'
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR!
npm ERR! System Darwin 11.3.0
npm ERR! command "/usr/local/bin/node" "/private/var/folders/6x/frvx23td327frc2z_hgl12sc0000gn/T/npm.3230/package/cli.js" "install" "-gf"
npm ERR! cwd /private/var/folders/6x/frvx23td327frc2z_hgl12sc0000gn/T/npm.3230/package
npm ERR! node -v v0.6.1
npm ERR! npm -v 1.1.1
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! message EACCES, permission denied '/usr/local/lib/node_modules'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/6x/frvx23td327frc2z_hgl12sc0000gn/T/npm.3230/package/npm-debug.log
npm not ok
It failed
Node version v0.6.1.
I looked around on the web and most of the answers are from node 0.4 days and they all just say upgrade. It looks like I am more up to date than those previous questions...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您执行此操作时:
您将以
root
身份运行curl
,但以当前用户身份运行sh
。你应该这样做:一切都会好起来的。
When you do this:
You will run
curl
asroot
, butsh
as your current user. You should do this instead:And all will be well.