Node&npm笔记

Lkeme SVIP+

前言

记一些Node&Npm使用记录

Node升级

以下命令,Linux可能需要权限

npm install -g n
n latest

如果windows下面报错,windows版本可以尝试下载官方的msi软件包覆盖安装,也是可行的

Npm升级

npm install -g npm

Npm更新

更新全局可更新的包

npm update -g

更新package.json可更新的包

npm update

检查npm包的状态

npm-check -u -g

查看哪些包有更新

npm -g outdated

全局安装

npm install -g

Nrm的使用

安装

npm install -g nrm

使用

显示registry可用列表

nrm ls

1
2
3
4
5
6
7
8
$ nrm ls

* npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
eu ----- http://registry.npmjs.eu/
au ----- http://registry.npmjs.org.au/
sl ----- http://npm.strongloop.com/
nj ----- https://registry.nodejitsu.com/

使用registry

nrm use cnpm

1
2
3
$ nrm use cnpm 

>>> Registry has been set to: http://r.cnpmjs.org/

测试registry的延迟

nrm test

END.

  • 标题: Node&npm笔记
  • 作者: Lkeme
  • 创建于 : 2018-03-21 09:06:35
  • 更新于 : 2024-04-15 15:30:53
  • 链接: https://mudew.com/2018/03/21/Node-npm笔记/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论