ionic-team / ionic-cli

The Ionic command-line interface
MIT License
2k stars 651 forks source link

Error creating project in ionic 2. Error with start undefined #1587

Closed jgw96 closed 7 years ago

jgw96 commented 7 years ago

From @souzacristsf on October 23, 2016 17:47

More open issue. Now this time tried a virtual machine to not lose hope to work with IONIC 2, but unfortunately without success again.

I am now with this error: ` 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

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

My virtual machine uname ` ` Souzacrists Linux 4.4.0-31-generic # 50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU / Linux `

My operating system: lsb_release -a ` In LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS Release: 16:04 Codename: xenial `

I already have this open issue. https://github.com/driftyco/ionic/issues/8868

I hope to answer that can help me solve. For not wait to start working with IONIC 2.

Copied from original issue: driftyco/ionic#8869

rodrigo-m-martins commented 7 years ago

I'm with same problem, as follow below:

D:\projetos>ionic start MyIonic2Project --v2 Creating Ionic app in folder D:\projetos\MyIonic2Project based on tabs project Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip [=============================] 100% 0.0s Downloading: https://github.com/driftyco/ionic2-starter-tabs/archive/master.zip [=============================] 100% 0.0s 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

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Using: vscode 1.6.1 node 6.5.0

Best regards, Rodrigo

jthoms1 commented 7 years ago

He have just released version 2.1.4 of the CLI. Could you please try the latest and let me know the results. One change we made is to provide more detail on npm issues. Thanks!

souzacristsf commented 7 years ago

definitely give up ionic 2 utimamente only has me stressed.

Updated:

Your system information:

Cordova CLI: 6.3.1 Ionic Framework Version: 2.0.0-rc.1 Ionic CLI Version: 2.1.4 Ionic App Lib Version: 2.1.2 Ionic App Version Scripts: 0.0.36 OS: / bin / sh: lsb_release: command not found

Node Version: v5.12.0

But unfortunately when I enter the project and type in the command.

ionic serve

Error: ENOENT: no such file or directory, open '/home/souzacrists/Documents/Curso-Ionic/meu-pedido/curso-iniciando/www/index.html'

Ta not easy to have a hope with Ionic.

domnicksharkey commented 7 years ago

Same issue:

C:\Projects>ionic start ionic2-tutorial-github blank --v2 --ts
Directory already exists: C:\Projects\ionic2-tutorial-github
Would you like to overwrite the directory with this new project?
(yes/no): y

Creating Ionic app in folder C:\Projects\ionic2-tutorial-github based on blank project
Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
[=============================]  100%  0.0s
Downloading: https://github.com/driftyco/ionic2-starter-blank/archive/master.zip
[=============================]  100%  0.0s
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

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

node: v4.4.5 ionic v2.1.0-beta.3 running on windows10 64bit OS

jthoms1 commented 7 years ago

We recently released a new version of the CLI that should allow us to gather more insight into NPM issues. Could you please update your CLI to at least 2.1.4?

npm install -g ionic@latest

Thank you!

domnicksharkey commented 7 years ago

Looks like the problem is that I didnt have git on my PATH

from the npm-debug.log:


61344 info install @ionic/app-scripts@0.0.36
61345 info postinstall @ionic/app-scripts@0.0.36
61346 verbose unlock done using C:\Users\Domnick\AppData\Roaming\npm-cache\_locks\ionic-app-scripts-273bc1e202862c8c.lock for C:\Projects\ionic2-tutorial-github\node_modules\@ionic\app-scripts
61347 verbose stack Error: not found: git
61347 verbose stack     at getNotFoundError (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:15:12)
61347 verbose stack     at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:70:19)
61347 verbose stack     at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:82:29)
61347 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:91:16
61347 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\index.js:44:5
61347 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:29:5
61347 verbose stack     at FSReqWrap.oncomplete (fs.js:82:15)
61348 verbose cwd C:\Projects\ionic2-tutorial-github
61349 error Windows_NT 10.0.14393
61350 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
61351 error node v4.4.5
61352 error npm  v2.15.5
61353 error code ENOGIT
61354 error not found: git
61355 error Failed using git.
61355 error This is most likely not a problem with npm itself.
61355 error Please check if you have git installed and in your PATH.
61356 verbose exit [ 1, true ]

I retried on git bash on windows to success.

ghost commented 7 years ago

npm install -g ionic@latest working for me. Now not getting below 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

jthoms1 commented 7 years ago

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

jthoms1 commented 7 years ago

Could you please try this again? We recently made changes to the app-base and this should no longer be an issue for you. Below is the commit that fixed the issue.

driftyco/ionic-storage@92f9032d97f32959e6ae6642bd4d37070792faf3

ghost commented 7 years ago
$ ionic info
--------------------------------
--------------------------------

Your system information:

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
Ionic App Scripts Version: 0.0.36
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v6.9.1
Xcode version: Not installed

--------------------------------
******************************************************
 Dependency warning - for the CLI to run correctly,      
 it is highly recommended to install/upgrade the following:     

 Install ios-sim to deploy iOS applications.`npm install -g ios-sim` (may require sudo)
 Install ios-deploy to deploy iOS applications to devices.  `npm install -g ios-deploy` (may require sudo)

******************************************************
ghost commented 7 years ago

I hava the same problem too.. I haven't solved it so far

dumildematos commented 7 years ago

it can't start the server

dumildematos@dumildematos:~/Documents/Intel XDK App/myAppO$ ionic serve WARN: No node_modules directory found, do you need to run npm install?

ionic-app-base@ ionic:serve /home/dumildematos/Documents/Intel XDK App/myAppO ionic-app-scripts serve

sh: 1: ionic-app-scripts: not found

npm ERR! Linux 4.4.0-57-generic npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "ionic:serve" "--" npm ERR! node v7.8.0 npm ERR! npm v4.2.0 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! ionic-app-base@ ionic:serve: ionic-app-scripts serve npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the ionic-app-base@ ionic:serve script 'ionic-app-scripts serve'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the ionic-app-base package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ionic-app-scripts serve npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs ionic-app-base npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls ionic-app-base npm ERR! There is likely additional logging output above. npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request: npm ERR! /home/dumildematos/.npm/_logs/2017-04-05T11_03_13_207Z-debug.log There was an error serving your Ionic application: There was an error with the spawned command: serve