Running 'serve:before' npm script before serve
> mobile_app_poc_ionic2@ watch /home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0
> ionic-app-scripts watch
[11:23:32] ionic-app-scripts 0.0.23
[11:23:32] watch started ...
[11:23:32] build dev started ...
[11:23:32] clean started ...
[11:23:32] clean finished in 4 ms
[11:23:32] copy started ...
[11:23:32] typescript compiler started ...
[11:23:32] lint started ...
[11:23:32]
[11:23:32] copy finished in 57 ms
[11:23:35] src/app/app.component.ts(1,38): error TS2307: Cannot find module '@angular/core'.
[11:23:35] src/app/app.module.ts(1,26): error TS2307: Cannot find module '@angular/core'.
[11:23:35] src/app/main.dev.ts(1,40): error TS2307: Cannot find module '@angular/platform-browser-dynamic'.
[11:23:35] src/pages/hello-ionic/hello-ionic.ts(1,27): error TS2307: Cannot find module '@angular/core'.
[11:23:35] src/pages/item-details/item-details.ts(1,27): error TS2307: Cannot find module '@angular/core'.
src/pages/list/list.ts(1,27): error TS2307: Cannot find module '@angular/core'.
[11:23:35] typescript compiler ready in 3.29 s
[11:23:35] bundle dev started ...
[11:23:35] Error: Could not resolve '@angular/platform-browser-dynamic' from /home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/.tmp/app/main.dev.js
at Error (native)
at /home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js:78:21
at /home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/browser-resolve/index.js:265:24
at /home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/resolve/lib/async.js:46:14
at process (/home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/resolve/lib/async.js:173:43)
at ondir (/home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/resolve/lib/async.js:188:17)
at load (/home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/resolve/lib/async.js:69:43)
at onex (/home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/resolve/lib/async.js:92:31)
at /home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:82:15)
[11:23:35] sass started ...
[11:23:35] sass failed: Cannot generate Sass files without first bundling JavaScript files in order to know all used modules. Please build JS files first.
[11:23:35] build dev failed: Build failed
[11:23:35]
[11:23:35] watch ready in 3.60 s
Running live reload server: http://10.0.0.129:35729
Watching: www/**/*, !www/lib/**/*
ā Running dev server: http://10.0.0.129:8100
Running 'serve:before' npm script before serve
> mobile_app_poc_ionic2@ watch /home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0
> ionic-app-scripts watch
[12:13:38] ionic-app-scripts 0.0.23
[12:13:38] watch started ...
[12:13:38] build dev started ...
[12:13:38] clean started ...
[12:13:38] clean finished in 10 ms
[12:13:38] copy started ...
[12:13:38] typescript compiler started ...
[12:13:39] lint started ...
[12:13:39]
[12:13:39] copy finished in 81 ms
[12:13:42] src/app/app.component.ts(1,38): error TS2307: Cannot find module '@angular/core'.
[12:13:42] src/app/app.module.ts(1,26): error TS2307: Cannot find module '@angular/core'.
[12:13:42] src/app/main.dev.ts(1,40): error TS2307: Cannot find module '@angular/platform-browser-dynamic'.
[12:13:42] src/pages/hello-ionic/hello-ionic.ts(1,27): error TS2307: Cannot find module '@angular/core'.
src/pages/item-details/item-details.ts(1,27): error TS2307: Cannot find module '@angular/core'.
[12:13:42] src/pages/list/list.ts(1,27): error TS2307: Cannot find module '@angular/core'.
[12:13:42] typescript compiler ready in 3.97 s
[12:13:42] bundle dev started ...
[12:13:43] Error: Could not resolve '@angular/platform-browser-dynamic' from /home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/.tmp/app/main.dev.js
at Error (native)
at /home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js:78:21
at /home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/browser-resolve/index.js:265:24
at /home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/resolve/lib/async.js:46:14
at process (/home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/resolve/lib/async.js:173:43)
at ondir (/home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/resolve/lib/async.js:188:17)
at load (/home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/resolve/lib/async.js:69:43)
at onex (/home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/resolve/lib/async.js:92:31)
at /home/andrei/Projects/var/Mobile_POC_Ionic/ionic2/mobile_app_poc_ionic2_rc0_angular2.0/node_modules/@ionic/app-scripts/node_modules/rollup-plugin-node-resolve/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:82:15)
[12:13:43] sass started ...
[12:13:43] sass failed: Cannot generate Sass files without first bundling JavaScript files in order to know all used modules. Please build JS files first.
[12:13:43] build dev failed: Build failed
[12:13:43]
[12:13:43] watch ready in 4.31 s
Running live reload server: http://10.0.0.129:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
ā Running dev server: http://10.0.0.129:8100
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown the server and exit
ionic $
After this error, run npm install , if you get some error related to git , than follow below steps, it resolved for me:
Go to https://git-for-windows.github.io/ and install git
than open git cmd
run below command:
git config --global url.āhttps://ā.insteadOf git://
I had a similar problem. According to https://github.com/driftyco/ionic/blob/master/CHANGELOG.md#copying-your-project-to-a-new-project you should not be on an ionic beta version. I tried uninstalling and reinstalling ionic cli globally and it still tells me I have version 2.0.0-beta.23.
My current workaround is to run npm run build. Otherwise it seems that ionic serve expects the www contents to already be built. I have npm version 3.10.3 node version 6.7.0. I hope this helps.
OK I found that I have to manualy remouve the .tmp folder content to avoid the build failed ā¦ Donāt know why it is not properly done when I run Serve or Run.