怎么npm 升级3.0npm版本到3.0.8

&&国之画&&&& &&&&&&
&& &&&&&&&&&&&&&&&&&&&&
鲁ICP备号-4
打开技术之扣,分享程序人生!966,690 十一月 独立访问用户
语言 & 开发
架构 & 设计
文化 & 方法
您目前处于:
NPM 3 Beta为Windows用户带来利好消息
NPM 3 Beta为Windows用户带来利好消息
注意: 挥一挥衣袖,带走满满干货,关注,时不时发福利呦!
Author Contacted
相关厂商内容
相关赞助商
为中小微企业提供!
告诉我们您的想法
允许的HTML标签: a,b,br,blockquote,i,li,pre,u,ul,p
当有人回复此评论时请E-mail通知我
zhang zhijia,.
允许的HTML标签: a,b,br,blockquote,i,li,pre,u,ul,p
当有人回复此评论时请E-mail通知我
允许的HTML标签: a,b,br,blockquote,i,li,pre,u,ul,p
当有人回复此评论时请E-mail通知我
赞助商链接
架构 & 设计
文化 & 方法
<及所有内容,版权所有 &#169;
C4Media Inc.
服务器由 提供, 我们最信赖的ISP伙伴。
北京创新网媒广告有限公司
京ICP备号-7
注意:如果要修改您的邮箱,我们将会发送确认邮件到您原来的邮箱。
使用现有的公司名称
修改公司名称为:
公司性质:
使用现有的公司性质
修改公司性质为:
使用现有的公司规模
修改公司规模为:
使用现在的国家
使用现在的省份
Subscribe to our newsletter?
Subscribe to our industry email notices?
我们发现您在使用ad blocker。
我们理解您使用ad blocker的初衷,但为了保证InfoQ能够继续以免费方式为您服务,我们需要您的支持。InfoQ绝不会在未经您许可的情况下将您的数据提供给第三方。我们仅将其用于向读者发送相关广告内容。请您将InfoQ添加至白名单,感谢您的理解与支持。a package manager for JavaScript
Last updated 20 days ago
$ cnpm install npm -g
missed versions from
npm(1) -- node package manager
This is just enough info to get you up and running.
Much more info available via npm help once it's installed.
You need node v0.8 or higher to run this program.
To install an old and unsupported version of npm that works on node 0.3
and prior, clone the git repo and dig through the old tags and branches.
Super Easy Install
npm comes with
Windows Computers
npm is in it.
Apple Macintosh Computers
npm is in it.
Other Sorts of Unices
Run make install.
npm will be installed with node.
If you want a more fancy pants install (a different version, customized
paths, etc.) then read on.
Fancy Install (Unix)
There's a pretty robust install script at
You can download that and run it.
Here's an example using curl:
curl -L https://npmjs.org/install.sh | sh
Slightly Fancier
You can set any npm configuration params with that script:
npm_config_prefix=/some/path sh install.sh
Or, you can run it in uber-debuggery mode:
npm_debug=1 sh install.sh
Even Fancier
Get the code with git.
Use make to build the docs and do other stuff.
If you plan on hacking on npm, make link is your friend.
If you've got the npm source code, you can also semi-permanently set
arbitrary config keys using the ./configure --key=val ..., and then
run npm commands by doing node cli.js &cmd& &args&.
(This is helpful
for testing, or running stuff without actually installing npm itself.)
Windows Install or Upgrade
You can download a zip file from , and unpack it
in the same folder where node.exe lives.
The latest version in a zip file is 1.4.12.
To upgrade to npm 2, follow the
Windows upgrade instructions in the npm Troubleshooting Guide:
If that's not fancy enough for you, then you can fetch the code with
git, and mess with it directly.
Installing on Cygwin
Permissions when Using npm to Install Other Stuff
Use sudo for greater safety.
Or don't, if you prefer not to.
npm will downgrade permissions if it's root before running any build
scripts that package authors specified.
More details...
As of version 0.3, it is recommended to run npm as root.
This allows npm to change the user identifier to the nobody user prior
to running any package build or test commands.
If you are not the root user, or if you are on a platform that does not
support uid switching, then npm will not attempt to change the userid.
If you would like to ensure that npm always runs scripts as the
&nobody& user, and have it fail if it cannot downgrade permissions, then
set the following configuration param:
npm config set unsafe-perm false
This will prevent running in unsafe mode, even as non-root users.
Uninstalling
So sad to see you go.
sudo npm uninstall npm -g
Or, if that fails,
sudo make uninstall
More Severe Uninstalling
Usually, the above instructions are sufficient.
That will remove
npm, but leave behind anything you've installed.
If you would like to remove all the packages that you have installed,
then you can use the npm ls command to find them, and then npm rm to
remove them.
To remove cruft left behind by npm 0.x, you can use the included
clean-old.sh script file.
You can run it conveniently like this:
npm explore npm -g -- sh scripts/clean-old.sh
npm uses two configuration files, one for per-user configs, and another
for global (every-user) configs.
You can view them by doing:
npm config get userconfig
# defaults to ~/.npmrc
npm config get globalconfig # defaults to /usr/local/etc/npmrc
Uninstalling npm does not remove configuration files by default.
must remove them yourself manually if you want them gone.
this means that future npm installs will not remember the settings that
you have chosen.
Using npm Programmatically
If you would like to use npm programmatically, you can do that.
It's not very well documented, but it is rather simple.
Most of the time, unless you actually want to do all the things that
npm does, you should try using one of npm's dependencies rather than
using npm itself, if possible.
Eventually, npm will be just a thin cli wrapper around the modules
that it depends on, but for now, there are some things that you must
use npm itself to do.
var npm = require(&npm&)
npm.load(myConfigObject, function (er) {
if (er) return handlError(er)
mands.install([&some&, &args&], function (er, data) {
if (er) return commandFailed(er)
// command succeeded, and data might have some info
npm.registry.log.on(&log&, function (message) { .... })
The load function takes an object hash of the command-line configs.
The various <mands.&cmd& functions take an array of
positional argument strings.
The last argument to any
<mands.&cmd& function is a callback.
Some commands take other
optional arguments.
Read the source.
You cannot set configs individually for any single npm function at this
Since npm is a singleton, any call to npm.config.set will
change the value for all npm commands in that process.
See ./bin/npm-cli.js for an example of pulling config values off of the
command line arguments using nopt.
You may also want to check out npm help config to learn about all the options you can set there.
Check out the ,
especially the .
You can use the npm help command to read any of them.
If you're a developer, and you want to use npm to publish your program,
you should
Legal Stuff
&npm& and &The npm Registry& are owned by npm, Inc.
All rights reserved.
See the included LICENSE file for more details.
&& and &node& are trademarks owned by Joyent, Inc.
Modules published on the npm registry are not officially endorsed by
npm, Inc. or the
Data published to the npm registry is not part of npm itself, and is
the sole property of the publisher.
While every effort is made to
ensure accountability, there is absolutely no guarantee, warrantee, or
assertion expressed or implied as to the quality, fitness for a
specific purpose, or lack of malice in any given npm package.
If you have a complaint about a package in the public npm registry,
and cannot , please email
and explain the situation.
Any data published to The npm Registry (including user account
information) may be removed or modified at the sole discretion of the
npm server administrators.
In plainer english
npm is the property of npm, Inc.
If you publish something, it's yours, and you are solely accountable
If other people publish something, it's theirs.
Users can publish Bad Stuff.
It will be removed promptly if reported.
But there is no vetting process for published modules, and you use
them at your own risk.
Please inspect the source.
If you publish Bad Stuff, we may delete it from the registry, or even
ban your account in extreme cases.
So don't do that.
When you find issues, please report them:
Be sure to include all of the output from the npm command that didn't work
as expected.
The npm-debug.log file is also helpful to provide.
You can also look for isaacs in # on irc://irc.freenode.net.
will no doubt tell you to put the output in a gist or email.
npm-faq(7)
npm-help(1)
npm-index(7)
Maintainers
This Month
Last Month
Dependencies (85)
Dev Dependencies (10)
Dependents (1406)
Copyright 2014 - 2016 & taobao.org |

我要回帖

更多关于 如何升级npm版本 的文章

 

随机推荐