1.升級提示
AndydeMacBook-Pro:soft andy$ sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
Password:
/usr/local/bin/cnpm -> /usr/local/lib/node_modules/cnpm/bin/cnpm
+ cnpm@6.1.0
added 325 packages from 182 contributors, removed 445 packages, updated 122 packages and moved 3 packages in 23.846s
╭────────────────────────────────────────────────────────────────╮
│ │
│ New minor version of npm available! 6.4.1 → 6.11.2 │
│ Changelog: https://github.com/npm/cli/releases/tag/v6.11.2 │
│ Run npm install -g npm to update! │
│ │
╰────────────────────────────────────────────────────────────────╯
解決方案:如上面文字提示
AndydeMacBook-Pro:npm install -g npm
升級出現(xiàn)的問題
問題原因:如上圖提示 問題原因為權限問題
解決方案:
AndydeMacBook-Pro:soft andy$ sudo npm install -g npm
Password:
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
+ npm@6.11.2
added 61 packages from 18 contributors, removed 18 packages and updated 69 packages in 7.903s