救命啊啊啊为什么我不能npm install 不能用

你的位置:
使用npm国内镜像解决npm install慢的问题
使用npm国内镜像解决npm install慢的问题npm国内镜像介绍cnpmjs.org 国产npm的逆袭Q: 我所在的企业有自己的包不方便发布到官方的npm?A: 使用cnpmjs.org 搭建一个企业内部的私有npm吧, 还能按需实时同步.Q: couchdb 好难部署...A: cnpmjs.org 已经使用node和mysql实现了npm registry 的所有api了. 跟 couchdb say goodbye.Q: tgz包下载好慢A: cnpmjs.org 开源版本已经直接使用七牛云存储了, 下载速度唰唰的.Q: ...A: 还犹豫什么?cnpm cli对于国内用户, 完全可以使用cnpm替代官方的npm来使用直接安装cnpm clienpm install -g cnpm或者完全不需要安装也行镜像使用方法(三种办法任意一种都能解决问题,建议使用第三种,将配置写死,下次用的时候配置还在): 1.通过config命令npm config set registry pmjs.org
npm info underscore (如果上面配置正确这个命令会有字符串response)2.命令行指定npm --registry pmjs.org info underscore 3.编辑 ~/.npmrc 加入下面内容registry = pmjs.org搜索镜像: 建立或使用镜像,参考: 参考:1.&2.&
转载请注明:
你可能还会对下面的内容感兴趣:
文使用npm国内镜像解决npm install慢的问题
浏览 4056 次
(C) 半叶寒羽(Yanue.net) |
| 粤ICP备号NPM install fails [NPM安装失败] - 问题-字节技术
NPM install fails
NPM安装失败
问题 (Question)
I am currently unable to install NPM on Mac OS, I have looked all over the place for someone with the same error, but I can't seem to find any. Could anyone give me a hand? This is what I get after running the curl command to install NPM:
All clean!
npm-install-94139.sh: line 302: 94407 Segmentation fault: 11
"$node" cli.js rm npm -gf
npm ERR! addLocal Could not install .
npm ERR! Error: EACCES, open '/Volumes/MacintoshHD/Users/Sebastian/.npm/3a52ce78-.lock'
{ [Error: EACCES, open '/Volumes/MacintoshHD/Users/Sebastian/.npm/3a52ce78-.lock']
code: 'EACCES',
path: '/Volumes/MacintoshHD/Users/Sebastian/.npm/3a52ce78-.lock' }
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 12.5.0
npm ERR! command "/usr/local/bin/node" "/private/var/folders/52/msjnslgn4qnfjgxfvg28f8kc0000gn/T/npm.94143/package/cli.js" "install" "-gf"
npm ERR! cwd /private/var/folders/52/msjnslgn4qnfjgxfvg28f8kc0000gn/T/npm.94143/package
npm ERR! node -v v0.8.19
npm ERR! npm -v 1.1.71
npm ERR! path /Volumes/MacintoshHD/Users/Sebastian/.npm/3a52ce78-.lock
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Volumes/MacintoshHD/Users/Sebastian/.npm/3a52ce78-.lock'
npm ERR! Additional logging details can be found in:
/private/var/folders/52/msjnslgn4qnfjgxfvg28f8kc0000gn/T/npm.94143/package/npm-debug.log
npm ERR! not ok code 0
我目前无法在MAC OS安装NPM,我到处都找过的同样的错误有人的地方,但我似乎无法找到。谁能给我一个手?这是我得到的运行安装NPM curl命令后:All clean!
npm-install-94139.sh: line 302: 94407 Segmentation fault: 11
"$node" cli.js rm npm -gf
npm ERR! addLocal Could not install .
npm ERR! Error: EACCES, open '/Volumes/MacintoshHD/Users/Sebastian/.npm/3a52ce78-.lock'
{ [Error: EACCES, open '/Volumes/MacintoshHD/Users/Sebastian/.npm/3a52ce78-.lock']
code: 'EACCES',
path: '/Volumes/MacintoshHD/Users/Sebastian/.npm/3a52ce78-.lock' }
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 12.5.0
npm ERR! command "/usr/local/bin/node" "/private/var/folders/52/msjnslgn4qnfjgxfvg28f8kc0000gn/T/npm.94143/package/cli.js" "install" "-gf"
npm ERR! cwd /private/var/folders/52/msjnslgn4qnfjgxfvg28f8kc0000gn/T/npm.94143/package
npm ERR! node -v v0.8.19
npm ERR! npm -v 1.1.71
npm ERR! path /Volumes/MacintoshHD/Users/Sebastian/.npm/3a52ce78-.lock
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Volumes/MacintoshHD/Users/Sebastian/.npm/3a52ce78-.lock'
npm ERR! Additional logging details can be found in:
/private/var/folders/52/msjnslgn4qnfjgxfvg28f8kc0000gn/T/npm.94143/package/npm-debug.log
npm ERR! not ok code 0
最佳答案 (Best Answer)
My guess is that a directory used by npm (maybe /usr/local or something in your home folder) has the wrong permissions. Installing with sudo might work now but it can also bite you later since you'll definitely create files and directories as root, possibly causing problems later when npm tries to cache things.
My advice would be to uninstall, then reinstall via nvm instead. This does a great job of managing different node versions under ~/.nvm without having to use sudo.
我的猜测是,一个用于NPM目录(也许/usr/local或者在你的家目录)有错误的权限。安装带有sudo可能现在的工作,但它也可以咬你后你肯定会创建文件和目录为根,可能造成的问题以后,NPM试图缓存的东西。我的建议是卸载,然后重新安装通过NVM相反。这是一项伟大的工作,管理不同的节点版本下~ /不使用sudo NVM。
答案 (Answer) 2
Did you try "sudo" with your curl command?
Also, if you install a new version of Node, it now includes NPM, so you don't have to even install NPM separately..
你试过“sudo”与您的卷曲的命令?也,如果你安装了新版本的节点,它包含了NPM,所以你甚至不需要安装NPM分开
答案 (Answer) 3
Try clearing npm cache with
npm cache clean
Hope that helps.
尝试清除缓存的大小npm cache clean 希望有帮助。
答案 (Answer) 4
From the NPM readme file:
SUPER EASY INSTALL
npm comes with node now.
Windows Computers
Get the MSI. npm is in it.
Apple Macintosh Computers
Get the pkg. npm is in it.
Other Sorts of Unices
Run make install. npm will be installed with
If you want a more fancy pants install (a different version, customized paths, etc.) then read on...
从新公共管理的自述文件: 超级容易的安装 新公共管理与节点现在。 Windows电脑 获得MSI。新公共管理是在它。 苹果的Macintosh电脑 把包。新公共管理是在它。 其他种类的Unices 运行安装。NPM将安装节点。 如果你想要一个更花哨的裤子安装(不同的版本,定制的路径,然后阅读等。)…
答案 (Answer) 5
The solution on this other question seems better than than messing around with NVM -
You need to unlock permissions in home directory, like Noah says.
sudo chown -R `whoami` ~/.npm
You also need to write it to your library as well, like Xilo says.
sudo chown -R `whoami` /usr/local/lib/node_modules
在这个问题的解决似乎比不是乱搞NVM—解决方案:你需要在家权限打开目录,像诺亚。sudo chown -R `whoami` ~/.npm
你还需要把它到您的图书馆一样,像Xilo说。sudo chown -R `whoami` /usr/local/lib/node_modules
本文翻译自StackoverFlow,英语好的童鞋可直接参考原文:
<a href="/learning/43398.html" target="_blank" title="OSX OSX <= 10.8.4 - Local Root Priv Escalation (py)}

我要回帖

更多关于 npm install 指定版本 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信