ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

ionic 2 error when creating a new project

Open doctor-mostafa79 opened this issue 10 years ago • 12 comments

I installed the release candidate. I updated node.js and npm. When I start a new project, I get this error:

Installing npm packages... Error with start undefined Error Initializing app: There was an error with the spawned command: npminstall There was an error with the spawned command: npminstall Caught exception: undefined

I uninstalled cordova and ionic and cleaned npm and then installed everything back, but no matter I did, I still get the same error every time I try to create a new project

Any help

screenshot_1

doctor-mostafa79 avatar Oct 04 '16 07:10 doctor-mostafa79

It may help them to have some info about your environment like the version of npm and ionic-cli plus the OS (name and version) too. Things like that…

Nonetheless this is a good example of why the ionic start command should not make npm install itself. Its job should be to generate code, not install all dependencies. It would be more align with the single responsibility principle.

This is a single line command that we can type next after generating the project. I say that because it makes the execution time very long especially on slow networks which can be very frustrating if you want to execute it several times for instance to see generated code for several templates or with different options. Just because you generate code doesn't mean you will execute it.

jondeodat avatar Oct 04 '16 09:10 jondeodat

I'm having the same problem after remove beta11 and install RC0.

I'm using npm 3.8.6 on Win7.

HectorFGarcia avatar Oct 04 '16 13:10 HectorFGarcia

Could you provide me with the output from ionic info from within your project directory? Thanks, this should help in troubleshooting.

jthoms1 avatar Oct 04 '16 13:10 jthoms1

After read https://github.com/driftyco/ionic-cli/issues/1424 I discovered, checking with --verbose, that I haven't installed "git for Windows'. Now it works.

HectorFGarcia avatar Oct 04 '16 14:10 HectorFGarcia

Similar problem here. npm version 3.10.3, Node.js 6.7.0, win 7 x64, ionic version 2.1.0. Problem came after i uninstalled previous ionic and installed the RC.

iammash avatar Oct 04 '16 14:10 iammash

Exact same issue here Windows 10, first-time ionic install just followed the directions to the letter and it failed. Company PC with windows 7, also vanilla install, also failed.

Solution: install Git for windows.

Please update/comment your dependencies.

As a first time user I was very annoyed.

klaus-kuplen avatar Oct 04 '16 20:10 klaus-kuplen

Installing Git resolved it for me too.

iammash avatar Oct 05 '16 06:10 iammash

npm upgrade solved this for me

firescout avatar Oct 05 '16 07:10 firescout

@jtoms1 err

zuhairHussain avatar Oct 05 '16 07:10 zuhairHussain

Unfortunately, I formatted my computer and installed a fresh win 10 on it. I will try installing git for windows, may be it works for me. Thanks for the help.

doctor-mostafa79 avatar Oct 08 '16 10:10 doctor-mostafa79

I installed Git for windows as recommended here from other members and everything works fine now. This info should be clear in ionic 2 RC0 documentations.

doctor-mostafa79 avatar Oct 10 '16 12:10 doctor-mostafa79

Hello all! Going to close this as a duplicate of https://github.com/driftyco/ionic-cli/issues/1491. Thanks!

jgw96 avatar Oct 12 '16 01:10 jgw96