2016-03-19 177 views
2

我在更新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> 

我已經卸載節點並重新安裝,但問題仍然存在。

我缺少什麼?

回答

2

你可以找到指令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可能會更好。