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***
答案 0 :(得分:2)
我在这里有类似的问题:Npm error after update ionic 2但现在已经解决了。
你可以看到我的答案,但试试这个:
npm uninstall -g ionic cordova
C:\Users\{YourUserNameHere}\AppData\Roaming\npm-cache
中的 npm-cache 文件夹(在我的情况下npm cache clean
无法正常工作)npm install -g cordova ionic@beta
并享受乐趣!就像我在错误中看到的那样,您尝试了 v5.6.0 节点版本和 2.0.0-beta.17 离子版本,现在尝试使用 v5。 8.0 和 2.0.0-beta.19 这是目前的最新版本。
P.S:当然不要忘记打开 cmd.exe 或您正在使用的任何命令提示符,管理员。
P.S2:对不起,如果我的英语不是很完美,但你会理解我。