NodeJs (一)

一、安装

 

1、查看 npm 源 是否 淘宝,如果不是 淘宝源 安装的时候可能出错!
 
npm config get registry
 
2、清除缓存
 
npm cache clean
npm cache clean --force
 
3、切换 npm 源  
 
//查看源地址

npm config get registry

  

//临时使用

npm --registry https://registry.npm.taobao.org

  

//持久使用  (一般都是持久使用,推荐淘宝源地址)


npm config set registry https://registry.npm.taobao.org

  

以下是源地址:
 
 
 
4、查看 npm 配置
 
npm config ls -l
 
 
 
原文地址:https://www.cnblogs.com/a-dou/p/12750094.html