简体   繁体   中英

ionic beta error when trying to create sample project from github

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***

I had similar problem here: Npm error after update ionic 2 but now is solved.

You can see my answer, but try this:

  1. Uninstall ionic and cordova with: npm uninstall -g ionic cordova
  2. Uninstall nodejs with the windows installer/uninstaller or use something like IObit Uninstaller to perform a clean and complete uninstall.
  3. Manually remove the npm-cache folder located in C:\\Users\\{YourUserNameHere}\\AppData\\Roaming\\npm-cache (in my case npm cache clean doesn't work)
  4. Restart your PC and now install nodejs , you can see that now there is a new version v5.8.0 and works perfect with ionic (at least for me).
  5. Install ionic and cordova: npm install -g cordova ionic@beta and have fun!

Like i see in your errors, you tried v5.6.0 node version and 2.0.0-beta.17 ionic version, try now with v5.8.0 and 2.0.0-beta.19 which are the last versions at the moment.

PS: Ofcourse don't forget to open the cmd.exe or whatever command prompt you are using, as Administrator .

P.S2: Sorry if my english isn't perfect, but you will understand me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM