1.將node的安裝目錄nodejs資料夾清空
2.查詢.npmrc檔案刪除(在使用者資料夾下)
npm config set prefix "c:\program files\nodejs\node_global"
npm config set cache "c:\program files\nodejs\node_cache"
6.設定**映象
npm config set registry
7.安裝模組測試
npm install express -g
$ npm install -g nrm
$ nrm ls
* npm ----
cnpm ---
eu -----
au -----
sl -----
nj -----
$ nrm use cnpm //switch registry to cnpm
registry has been set to:
使用的源就切換成功啦
1.如果安裝任何模組都報404錯誤,請檢視.npmrc是否被刪除
npm解除安裝與安裝
1.解除安裝node npm 1 先解除安裝 npm sudo npm uninstall npm g 2 然後解除安裝 node.js.2.1 如果是 ubuntu 系統並使用 apt get 安裝的,可以使用命令 sudo apt get remove nodejs 2.2 原始檔安裝的node...
npm安裝Vue及配置
1 cmd視窗檢視node.js版本和npm映象版本 檢視本地npm版本 npm v 安裝vue cli 全域性安裝vue cli 命令 cnpm install vue cli g 如何檢視npm預設安裝路徑 執行命令 npm config get prefix 由於npm全域性模組的存放路徑及c...
npm解除安裝模組報錯
場景 在沒有通過npm init初始化目錄的情況下,直接通過cnpm命令安裝模組,在解除安裝模組時報錯 報錯 name cannot start with an underscore name can only contain url friendly characters 原因分析 通過cnpm命...