最近使用npm install总是报错
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "update" "npm"
npm ERR! node v6.2.0
npm ERR! npm v2.14.19
npm ERR! shasum check failed for C:\Users\kuaima\AppData\Local\Temp\npm-18136-7181dc7d\registry.npmjs.org\npm\-\npm-4.0.5.tgz
npm ERR! Expected: a9c3c00c3c5bd6b0538c71109e019afd9d5b1403
npm ERR! Actual: 229ee9303b213d8ad584a6d4f65b971874d5b0e9
npm ERR! From: https://registry.npmjs.org/npm/-/npm-4.0.5.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Program Files\nodejs\npm-debug.log
原因是node环境没有做好,需要手动配置环境变量,计算机 => 系统属性 => 高级系统设置 => 环境变量 => 添加
变量:PATH,值C:\Program Files\nodejs;C:\Users\asus\AppData\Roaming\npm
变量:NODE_PATH,值C:\Program Files\nodejs\node_modules
更新后需要重启才能起作用,也可以安装新版node,安装时选择ADD TO PATH选项
,就不必自己手动配置环境变量了