一:更新npm
npm install npm@latest -g
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。
二:更新node
通过where node命令查看node路径
C:\Users\lenovo>where node
D:\downloads\node.js\node.exe
- 3.双击刚刚下载的文件node-v8.12.0-x64.msi
点击next 具体安装方法和之前第一次安装一样,但是注意在选择路径的时候要选成上面查到的node路径中。
- 4.安装完成。通过
npm -v
和node -v
查看当前版本号