2.根据官网(https://www.npmjs.com/get-npm)提供的命令更新:node
npm install npm@latest -g
3.个人电脑出现了以下错误:npm
C:\Users\lenovo\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js:79 let notifier = require('update-notifier')({pkg}) ^^^ SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:373:25) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module.runMain (module.js:441:10) at startup (node.js:139:18) at node.js:968:3
4.在网上搜索了相关资料发现是node版本太低的缘由,因此咱们接下来更新node。ide
2.将下载的文件安装到以前安装node.js的地方ui
经过where node命令查看node路径 C:\Users\lenovo>where node D:\downloads\node.js\node.exe
3.双击刚刚下载的文件node-v8.12.0-x64.msicode
点击next 具体安装方法和以前第一次安装同样,可是注意在选择路径的时候要选成上面查到的node路径中。
4.安装完成。经过npm -v
和node -v
查看当前版本号v8