更新Windows 10后,npm安装失败

问题描述:

我在更新Windows后,无法运行npm命令。更新Windows 10后,npm安装失败

我正在尝试安装ember-cli但我收到了很多错误。

F:\DEV\Ember\Ember1>npm install -g ember-cli 
SyntaxError: Error parsing C:\Users\vitorpfn\AppData\Roaming\npm\node_modules\npm\node_modules\request\node_modules\extend\package.json: Unexpected token p 
    at Object.parse (native) 
    at readPackage (module.js:81:52) 
    at tryPackage (module.js:91:13) 
    at Function.Module._findPath (module.js:153:20) 
    at Function.Module._resolveFilename (module.js:323:25) 
    at Function.Module._load (module.js:276:25) 
    at Module.require (module.js:353:17) 
    at require (internal/module.js:12:17) 
    at Object.<anonymous> (C:\Users\vitorpfn\AppData\Roaming\npm\node_modules\npm\node_modules\request\index.js:17:29) 
    at Module._compile (module.js:409:26) 
npm ERR! Windows_NT 10.0.10586 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\vitorpfn\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ember-cli" 
npm ERR! node v4.4.0 
npm ERR! npm v3.5.3 
npm ERR! path C:\Users\vitorpfn\AppData\Roaming\npm\node_modules\npm\node_modules\request\node_modules\extend\package.json 

npm ERR! Error parsing C:\Users\vitorpfn\AppData\Roaming\npm\node_modules\npm\node_modules\request\node_modules\extend\package.json: Unexpected token p 
npm ERR! 
npm ERR! If you need help, you may report this error at: 
npm ERR!  <https://github.com/npm/npm/issues> 

我已经卸载节点并重新安装,但问题仍然存在。

我缺少什么?

你可以找到指令installing ember-cli on Windows herehere

最重要的步骤:

  1. the official installer
  2. 始终打开PowerShell的或CMD作为管理员安装Node.js的。
  3. 安装Git for Windows
  4. 打开PowerShell中以管理员身份并运行$ Set-ExecutionPolicy Unrestricted -scope Process
  5. 安装灰烬-CLI-的Windows:$ npm install -g ember-cli-windows
  6. 运行灰烬-CLI-的Windows:$ ember-cli-windows
  7. 注销并在Windows
  8. 重新登录
  9. 更新npm:​​
  10. 安装余烬:$ npm install -g ember-cli

您必须使用PowerShell进行某些设置,但从长远来看,如果使用Git Shell可能会更好。