npm安装

What is npm?

npm makes it easy for JavaScript developers to share and reuse code, and makes it easy to update the code that you’re sharing, so you can build amazing things.

Install npm

npm is installed with Node.js

npm is distributed with Node.js- which means that when you download Node.js, you automatically get npm installed on your computer.

Download Node.js and npm

Check that you have node and npm installed

To check if you have Node.js installed, run this command in your terminal:

node -v

To confirm that you have npm installed you can run this command in your terminal:

npm -v

A note on versions

npm versions

npm is a separate project from Node.js, and tends to update more frequently. As a result, even if you’ve just downloaded Node.js (and therefore npm), you’ll probably need to update your npm. Luckily, npm knows how to update itself! To update your npm, type this into your terminal:

npm install npm@latest -g

Node versions and Long Term Support

Node.js has lots of versions! To use Node.js, and therefore npm, effectively, you’ll want to make sure that you are on a version that is supported by the Node.js team. In general, you should use the version of Node.js labelled “LTS”.

Use a Node.js version manager

Software is always changing, and so it’s often a good practice to use a version manager to help account for this change. For this reason (and many others!) we recommend that you use a version manager for your Node.js installation. There are many great options; here are a few*:

* If you don't see your favorite version manager here, send us a note on the www repo!


Read the docs!

For more information, on all sorts of awesome npm things, you should read our documentation.

You’ll learn how to:

If you ever want to help out with documentation, you can file issues and pull requests on our docs repo!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值