ionic beta error when trying to create sample project from github

时间:2016-02-12 21:12:34

标签: node.js cordova ionic2

I am using windows 10 and I am trying to create an ionic project using the sample template on the github, but I am getting the following error:

D:\Programming Exercise\mobile\ionic2Samples>ionic start MyIonic2Project tutorial --v2 --ts One awesome Ionic app coming right up... Downloading: https://github.com/driftyco/ionic2-app-base/archive/typescript.zip Downloading: https://github.com/driftyco/ionic2-starter-tutorial/archive/typescript.zip Installing Node Modules Unable to run exec commandError: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "npm install" npm WARN MyIonic2Project No description npm WARN MyIonic2Project No repository field. npm WARN MyIonic2Project No license field. npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" npm ERR! node v5.6.0 npm ERR! npm v3.6.0 npm ERR! path D:\Programming Exercise\mobile\ionic2Samples\MyIonic2Project\node_modules\json5\lib\cli.js npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall chmod npm ERR! enoent ENOENT: no such file or directory, chmod 'D:\Programming Exercise\mobile\ionic2Samples\MyIonic2Project\node_modules\json5\lib\cli.js' npm ERR! enoent ENOENT: no such file or directory, chmod 'D:\Programming Exercise\mobile\ionic2Samples\MyIonic2Project\node_modules\json5\lib\cli.js' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent npm ERR! Please include the following file with any support request: npm ERR! D:\Programming Exercise\mobile\ionic2Samples\MyIonic2Project\npm-debug.log (CLI v2.0.0-beta.17) Your system information: Cordova CLI: 6.0.0 Ionic CLI Version: 2.0.0-beta.17 Ionic App Lib Version: 2.0.0-beta.8 OS: Node Version: v5.6.0***

1 个答案:

答案 0 :(得分:2)

我在这里有类似的问题:Npm error after update ionic 2但现在已经解决了。

你可以看到我的答案,但试试这个:

  1. 使用以下代码卸载ionic和cordova:npm uninstall -g ionic cordova
  2. 使用Windows安装程序/卸载程序卸载nodejs或使用IObit Uninstaller之类的内容执行干净完整的卸载。
  3. 手动删除C:\Users\{YourUserNameHere}\AppData\Roaming\npm-cache中的 npm-cache 文件夹(在我的情况下npm cache clean无法正常工作)
  4. 重新启动您的电脑并立即安装nodejs,您可以看到现在有一​​个新版本 v5.8.0 ,并且与离子完美配合(至少对我而言)。
  5. 安装ionic和cordova:npm install -g cordova ionic@beta并享受乐趣!
  6. 就像我在错误中看到的那样,您尝试了 v5.6.0 节点版本和 2.0.0-beta.17 离子版本,现在尝试使用 v5。 8.0 2.0.0-beta.19 这是目前的最新版本。

    P.S:当然不要忘记打开 cmd.exe 或您正在使用的任何命令提示符,管理员

    P.S2:对不起,如果我的英语不是很完美,但你会理解我。