今天npm提示能夠更新:node
╭─────────────────────────────────────╮ │ │ │ Update available 5.6.0 → 5.7.1 │ │ Run npm i -g npm to update │ │ │ ╰─────────────────────────────────────╯
執行了一下,發現報錯npm
➜ ~ ✗ npm i -g npm npm ERR! Unexpected end of JSON input while parsing near '...ist":{"shasum":"b779a' npm ERR! A complete log of this run can be found in: npm ERR! /Users/user/.npm/_logs/2018-03-15T05_56_22_902Z-debug.log
因而清理了一下cache,再執行,成功bash
➜ ~ ✗ npm cache clean --force npm WARN using --force I sure hope you know what you are doing. ➜ ~ ✗ sudo npm i -g npm /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@5.7.1 added 63 packages, removed 6 packages and updated 49 packages in 17.184s