Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Error running newly created app (v2) #253

Closed
jthoms1 opened this issue Oct 28, 2016 · 35 comments
Closed

Error running newly created app (v2) #253

jthoms1 opened this issue Oct 28, 2016 · 35 comments

Comments

@jthoms1
Copy link
Member

jthoms1 commented Oct 28, 2016

From @rodrigograca31 on October 18, 2016 20:33

Short description of the problem:

Error creating new app. (--v2)

What behavior are you expecting?

It should "compile" and run the app....

Steps to reproduce:

  1. ionic start app --v2
  2. cd app/
  3. ionic platform add android
  4. ionic run android
Running 'run:before' npm script before run

> ionic-hello-world@ build /home/unknown/git/app
> ionic-app-scripts build

[21:29:52]  ionic-app-scripts 0.0.36 
[21:29:52]  build prod started ... 
[21:29:52]  clean started ... 
[21:29:52]  clean finished in 3 ms 
[21:29:52]  copy started ... 
[21:29:52]  ngc started ... 
[21:29:52]  copy finished in 28 ms 
[21:29:53]  lint started ... 
[21:29:54]  lint finished in 1.23 s 
[21:29:54]  can't resolve module @angular/core/src/di/opaque_token from /home/unknown/git/app/.tmp/index.ts 
[21:29:54]  TypeError: undefined is not a function 
[21:29:54]  ngc failed 
[21:29:54]  ionic-app-script task: "build" 
[21:29:54]  Error: Error 

npm ERR! Linux 3.19.0-32-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build" "--color"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@ build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ionic-hello-world@ build script 'ionic-app-scripts build'.
npm ERR! This is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build
npm ERR! You can get their info via:
npm ERR!     npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/unknown/git/app/npm-debug.log
Caught exception:
 undefined 

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

Post the output of ionic info below please

Your system information:

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.0
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
Ionic App Scripts Version: 0.0.36
OS: Distributor ID:     LinuxMint Description:  Linux Mint 17.3 Rosa 
Node Version: v0.12.7

Copied from original issue: ionic-team/ionic-cli#1562

@jthoms1
Copy link
Member Author

jthoms1 commented Oct 28, 2016

From @rodrigograca31 on October 18, 2016 20:33

ionic serve works fine...

@jthoms1
Copy link
Member Author

jthoms1 commented Oct 28, 2016

From @MasterProgrammer200 on October 19, 2016 15:32

I am having the same issue.

  1. ionic start cutePuppyPics --v2
  2. cd cutePuppyPics
  3. ionic serve <--- this works!
  4. ionic g page myPage <---- error!
    image
  5. ionic build <---- error!
    image

Ionic Info:
image

@jthoms1
Copy link
Member Author

jthoms1 commented Oct 28, 2016

From @rodrigograca31 on October 19, 2016 22:4

@MasterProgrammer200 you should have posted your erro in text so it could be indexed.....
Since you are using Windows this confirms it's not platform specific...

@danbucholtz
Copy link
Contributor

@rodrigograca31,

This is an ngc error. ngc has really bad error messages sometimes. Unfortunately, there isn't anything we can do other than work with the Angular team to improve this, so that is what we're doing. I'm going to close this for now.

Thanks,
Dan

@rodrigograca31
Copy link

ngc error?

Yes, they could get better error messages, but how do I solve this problem?

@danbucholtz
Copy link
Contributor

@rodrigograca31, The issue is in your code, so you need to find out where it is in your code and fix it. Otherwise, the alternative is to not use ngc by adding --dev to the end of the build command in the scripts section of package.json.

Thanks,
Dan

@rodrigograca31
Copy link

@danbucholtz On my code? Nope!
This is a brand new app, not even one line was modified!
If you see the "Steps to reproduce:" you can see that I create a new app and run it and it doesn't run...
That's a pretty bad experience for a new user....

@danbucholtz
Copy link
Contributor

@rodrigograca31,

Ahh, we were burned by a semver issue temporarily. Angular made some breaking changes to their compiler. Update your package.json and remove the ^ everywhere, and then do a fresh npm install. That will fix it.

Thanks,
Dan

@swizard
Copy link

swizard commented Oct 29, 2016

@danbucholtz I did what you said.
delete every ^
delete node_moduldes
npm install .

still not working

@rodrigograca31
Copy link

rodrigograca31 commented Oct 29, 2016

@danbucholtz Still not working like @swizard said ....

Commands:

ionic start app4 --v2          <-- app created
cd app4
cordova platform add android
ionic run android              <-- error (just testing if it would work...)
nano package.json              <-- removed ^ from "@ionic/app-scripts" and "typescript"
rm -rf node_modules/           <-- removed the modules folder
npm install                    <-- reinstalled them...
ionic run android              <-- error again....

Error: (output from ionic run android)

Running 'run:before' npm script before run

> ionic-hello-world@ build /home/unknown/git/app4
> ionic-app-scripts build

[20:26:16]  ionic-app-scripts 0.0.36 
[20:26:16]  build prod started ... 
[20:26:16]  clean started ... 
[20:26:16]  clean finished in 13 ms 
[20:26:16]  copy started ... 
[20:26:16]  ngc started ... 
[20:26:16]  copy finished in 73 ms 
[20:26:17]  lint started ... 
[20:26:20]  lint finished in 2.51 s 
[20:26:20]  can't resolve module @angular/core/src/di/opaque_token from /home/unknown/git/app4/.tmp/index.ts 
[20:26:20]  TypeError: undefined is not a function 
[20:26:20]  ngc failed 
[20:26:20]  ionic-app-script task: "build" 
[20:26:20]  Error: Error 

npm ERR! Linux 3.19.0-32-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build" "--color"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@ build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ionic-hello-world@ build script 'ionic-app-scripts build'.
npm ERR! This is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build
npm ERR! You can get their info via:
npm ERR!     npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/unknown/git/app4/npm-debug.log
Caught exception:
 undefined 

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

@danbucholtz
Copy link
Contributor

danbucholtz commented Oct 30, 2016

You need to remove the ^ from all entries in the package.json, or atleast anything with an @angular/xyz prefix. The issue is @angular/compiler or @angular/compiler-cli had a breaking change that they did not realize. We compiled (ngc) ionic-angular with 0.6.2 and something in the latest breaks compatibility with it even though it's not supposed to.

Thanks,
Dan

@rodrigograca31
Copy link

There was ^ only on those two palces ("@ionic/app-scripts" and "typescript")

My package.json:

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },
  "dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/compiler-cli": "0.6.2",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/platform-server": "2.0.0",
    "@ionic/storage": "1.1.6",
    "ionic-angular": "2.0.0-rc.1",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.21"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.36",
    "typescript": "2.0.3"
  },
  "description": "app4: An Ionic project",
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": []
}

@danbucholtz
Copy link
Contributor

@rodrigograca31,

Can you provide us a sample repository recreating the issue?

Thanks,
Dan

@macdasi
Copy link

macdasi commented Oct 31, 2016

Same problem for me

@macdasi
Copy link

macdasi commented Oct 31, 2016

[13:18:08] ionic-app-scripts 0.0.38
[13:18:08] build prod started ...
[13:18:08] clean started ...
[13:18:08] clean finished in 4 ms
[13:18:08] copy started ...
[13:18:08] ngc started ...
[13:18:08] copy: Error copying "C:\Repos\patient-portal\src\manifest.json" to
"C:\Repos\patient-portal\www\manifest.json": File not found
[13:18:08] copy: Error copying "C:\Repos\patient-portal\src\service-worker.js" to
"C:\Repos\patient-portal\www\service-worker.js": File not found
[13:18:08] copy finished in 80 ms
[13:18:09] lint started ...
[13:18:09] C:\Repos\patient-portal\node_modules@angular\compiler-cli\src\private_import_compiler.js:10
[13:18:09] exports.AssetUrl = compiler_1.compiler_private.AssetUrl;
[13:18:09] TypeError: Cannot read property 'AssetUrl' of undefined
[13:18:09] ngc failed
[13:18:09] ionic-app-script task: "build"
[13:18:09] Error: Error

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\hadar.m\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "build"
npm ERR! node v6.3.1
npm ERR! npm v3.10.5
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@ build: ionic-app-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world@ build script 'ionic-app-scripts build'.

@rodrigograca31
Copy link

rodrigograca31 commented Oct 31, 2016

@danbucholtz Do you want the code that is causing the issue? It's the "standard" code when you create a new app using: ionic start app4 --v2 (The tabs ionic 2 project)

But here you go: (Note: Just removed "node_modules" folder because it had more than 100MB!!! What?)
(and GitHub was complaining about the .zip size...)
app4.zip

@rodrigograca31
Copy link

@macdasi Your eror seems different.... [13:18:09] TypeError: Cannot read property 'AssetUrl' of undefined

and I've also noticed ionic-app-scripts 0.0.38

@rodrigograca31
Copy link

@danbucholtz Now you have the .zip file but I will include here the npm-debug.log file contents:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build',
1 verbose cli   '--color' ]
2 info using npm@2.11.3
3 info using node@v0.12.7
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info prebuild ionic-hello-world@
6 info build ionic-hello-world@
7 verbose unsafe-perm in lifecycle true
8 info ionic-hello-world@ Failed to exec build script
9 verbose stack Error: ionic-hello-world@ build: `ionic-app-scripts build`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
9 verbose stack     at EventEmitter.emit (events.js:110:17)
9 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack     at ChildProcess.emit (events.js:110:17)
9 verbose stack     at maybeClose (child_process.js:1015:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
10 verbose pkgid ionic-hello-world@
11 verbose cwd /home/unknown/git/app6
12 error Linux 3.19.0-32-generic
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build" "--color"
14 error node v0.12.7
15 error npm  v2.11.3
16 error code ELIFECYCLE
17 error ionic-hello-world@ build: `ionic-app-scripts build`
17 error Exit status 1
18 error Failed at the ionic-hello-world@ build script 'ionic-app-scripts build'.
18 error This is most likely a problem with the ionic-hello-world package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     ionic-app-scripts build
18 error You can get their info via:
18 error     npm owner ls ionic-hello-world
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

@danbucholtz
Copy link
Contributor

danbucholtz commented Oct 31, 2016

@rodrigograca31,

When I run ionic run android or npm run build, I get the following output:

> ionic-hello-world@ build /Users/dan/Downloads/app4
> ionic-app-scripts build

[09:50:59]  ionic-app-scripts 0.0.38
[09:50:59]  build prod started ...
[09:50:59]  clean started ...
[09:50:59]  clean finished in 4 ms
[09:50:59]  copy started ...
[09:50:59]  ngc started ...
[09:50:59]  copy finished in 30 ms
[09:50:59]  lint started ...
[09:51:00]  lint finished in 717 ms
[09:51:10]  ngc finished in 10.48 s
[09:51:10]  webpack started ...
[09:51:15]  webpack finished in 4.98 s
[09:51:15]  uglifyjs started ...
[09:51:15]  sass started ...
[09:51:15]  sass finished in 910 ms
[09:51:15]  cleancss started ...
[09:51:16]  cleancss finished in 972 ms
[09:51:22]  uglifyjs finished in 7.46 s
[09:51:22]  build prod finished in 22.93 s

That is the expected output. Are you not seeing that? I did update @ionic/app-scripts to 0.0.38 since it's the latest.

Thanks,
Dan

@ronakkaria
Copy link

I didn't have the exact error as @rodrigograca31, but I was getting weird build errors as well (on 0.0.36). Unrecognized token '@' etc

Updating to 0.0.38 fixed the issues for me 👍

@ronakkaria
Copy link

ronakkaria commented Oct 31, 2016

Ok it's the darndest thing, but on 0.0.38 the build errors go away, but what used to be the build error shows up on the console on app start.

Pasting the error here just to show how ridiculous it is

screen shot 2016-10-31 at 8 52 06 pm

This is was very similar to the build error I was getting on 0.0.36.

During development I use livereload, by running an npm run watch on a another terminal, so that changes in src are watched for and files are automatically transpiled and copied into the build folder, triggering an update to the main.js file.

If I remove the HeroService mentioned in the screenshot of the error above, and remove all references of it, there's no console errors. And keepinglivereload running, if I make the changes to bring back the HeroService, the app works fine and there's no error in the console.

The console error is only seen if I include HeroService at the time of build via ionic run android So something is definitely wrong with the build process.

@danbucholtz Any thoughts?

EDIT: I take that back. Sort of. The error turned out to be because there was a typo in my import statement for HeroService. I was importing with the .ts extension. Hence even though the service was transpiled to .js correctly, the code requiring the .ts file directly.

I still don't get how the watch script differs from the build script in this regard. The code worked with the watch script. But discussing that doesn't make sense on this thread now. These are obviously unrelated issues

@rodrigograca31
Copy link

rodrigograca31 commented Oct 31, 2016

@danbucholtz I get this when I run that command: (0.0.36)

> ionic-hello-world@ build /home/unknown/git/app6
> ionic-app-scripts build

[18:00:06]  ionic-app-scripts 0.0.36 
[18:00:06]  build prod started ... 
[18:00:06]  clean started ... 
[18:00:06]  clean finished in 4 ms 
[18:00:06]  copy started ... 
[18:00:06]  ngc started ... 
[18:00:06]  copy finished in 50 ms 
[18:00:07]  lint started ... 
[18:00:09]  lint finished in 1.66 s 
[18:00:09]  can't resolve module @angular/core/src/di/opaque_token from /home/unknown/git/app6/.tmp/index.ts 
[18:00:09]  TypeError: undefined is not a function 
[18:00:09]  ngc failed 
[18:00:09]  ionic-app-script task: "build" 
[18:00:09]  Error: Error 

npm ERR! Linux 3.19.0-32-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@ build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ionic-hello-world@ build script 'ionic-app-scripts build'.
npm ERR! This is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build
npm ERR! You can get their info via:
npm ERR!     npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/unknown/git/app6/npm-debug.log

I will update to 0.0.38 and let you know if it solves the problem...

@rodrigograca31
Copy link

Upgrading to 0.0.38 didn't solve the issue... 😢

@danbucholtz
Copy link
Contributor

@rodrigograca31, can you blow away node_modules and verify that 2.0.0 is installed for Angular dependencies and @angular/compiler-cli is version 0.6.2? We haven't seen or heard of this issue before and can't recreate it.

Thanks,
Dan

@rodrigograca31
Copy link

@danbucholtz I've created another test app and the same happens:

ionic start app7 --v2
cd app7/
rm -rf node_modules/
nano package.json 
npm install
ionic run android 

Error output:

Running 'run:before' npm script before run

> ionic-hello-world@ build /home/unknown/git/app7
> ionic-app-scripts build

[19:01:15]  ionic-app-scripts 0.0.38 
[19:01:15]  build prod started ... 
[19:01:15]  clean started ... 
[19:01:15]  clean finished in 3 ms 
[19:01:15]  copy started ... 
[19:01:15]  ngc started ... 
[19:01:15]  copy finished in 43 ms 
[19:01:15]  lint started ... 
[19:01:17]  lint finished in 1.38 s 
[19:01:17]  can't resolve module @angular/core/src/di/opaque_token from /home/unknown/git/app7/.tmp/index.ts 
[19:01:17]  TypeError: undefined is not a function 
[19:01:17]  ngc failed 
[19:01:17]  ionic-app-script task: "build" 
[19:01:17]  Error: Error 

npm ERR! Linux 3.19.0-32-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build" "--color"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@ build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ionic-hello-world@ build script 'ionic-app-scripts build'.
npm ERR! This is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build
npm ERR! You can get their info via:
npm ERR!     npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/unknown/git/app7/npm-debug.log
Caught exception:
 undefined 

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

npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build',
1 verbose cli   '--color' ]
2 info using npm@2.11.3
3 info using node@v0.12.7
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info prebuild ionic-hello-world@
6 info build ionic-hello-world@
7 verbose unsafe-perm in lifecycle true
8 info ionic-hello-world@ Failed to exec build script
9 verbose stack Error: ionic-hello-world@ build: `ionic-app-scripts build`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
9 verbose stack     at EventEmitter.emit (events.js:110:17)
9 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack     at ChildProcess.emit (events.js:110:17)
9 verbose stack     at maybeClose (child_process.js:1015:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
10 verbose pkgid ionic-hello-world@
11 verbose cwd /home/unknown/git/app7
12 error Linux 3.19.0-32-generic
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build" "--color"
14 error node v0.12.7
15 error npm  v2.11.3
16 error code ELIFECYCLE
17 error ionic-hello-world@ build: `ionic-app-scripts build`
17 error Exit status 1
18 error Failed at the ionic-hello-world@ build script 'ionic-app-scripts build'.
18 error This is most likely a problem with the ionic-hello-world package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     ionic-app-scripts build
18 error You can get their info via:
18 error     npm owner ls ionic-hello-world
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

package.json:

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },
  "dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/compiler-cli": "0.6.2",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/platform-server": "2.0.0",
    "@ionic/storage": "1.1.6",
    "ionic-angular": "2.0.0-rc.1",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.21"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.38",
    "typescript": "2.0.6"
  },
  "description": "app7: An Ionic project",
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": []
}

Keep in mind that this is a brand new app... (created with: ionic start app7 --v2)

@danbucholtz
Copy link
Contributor

What version of node are you using? What version of npm? What OS are you using? Is there anything unique about your environment? I have created about 5 projects today and haven't had that issue at all. I think it is something external to Ionic.

Thanks,
Dan

@rodrigograca31
Copy link

@jthoms1 posted my original ionic info output but I will add it again:

--------------------------------

Your system information:

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.0
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
Ionic App Scripts Version: 0.0.38
OS: Distributor ID:     LinuxMint Description:  Linux Mint 17.3 Rosa 
Node Version: v0.12.7

--------------------------------

@danbucholtz
Copy link
Contributor

@rodrigograca31,

We don't support that version of Node.js anymore. Please update to the latest LTS release. I think that will resolve your issues.

Thanks,
Dan

@rodrigograca31
Copy link

Ok.... It's solved. I've used the following commands:

node -v <-- v0.12.7

sudo npm install n -g
sudo n stable

node -v <-- v7.0.0

🎉 🎉 🎉
🎊 🎊 🎊

@danbucholtz Thanks! Have some: 🍰
Now the world will have another app! (I will make millions with this app! or not... 😢)

@rodrigograca31
Copy link

Now ionic run android executes normally.

@danbucholtz
Copy link
Contributor

@rodrigograca31, glad to hear it! Have a good day and happy hacking!

Thanks,
Dan

@kchat001
Copy link

kchat001 commented Dec 5, 2016

Hi Dan,
it seems that I still have a similar problem. Today I am migrating from beta.37 to rc3 and I get some weird errors when doing
ionic build android
ionic serve works absolutely fine and the app starts in the browser. But doing a built I get the following error:

[20:08:11]  ionic-app-scripts 0.0.46
[20:08:11]  build prod started ...
[20:08:11]  clean started ...
[20:08:11]  clean finished in 4 ms
[20:08:11]  copy started ...
[20:08:11]  ngc started ...
[20:08:11]  copy: Error copying
            "/Users/me/projects/migration/myApp/node_modules/ionic-angular/fonts" to
            "/Users/me/projects/migration/myApp/www/assets/fonts"
[20:08:11]  copy finished in 118 ms
[20:08:26]  Error: Error at
            /Users/me/projects/migration/myApp/.tmp/pages/welcome/welcome.ngfactory.ts:328:40
[20:08:26]  Property 'rootPage' does not exist on type 'WelcomePage'.
[20:08:26]  Error at
            /Users/me/projects/migration/myApp/.tmp/pages/nav-frame/nav-frame.ngfactory.ts:454:149
[20:08:26]  Argument of type 'Date' is not assignable to parameter of type 'string'.
[20:08:26]  Error at
            /Users/me/projects/migration/myApp/.tmp/pages/nav-frame/nav-frame.ngfactory.ts:454:378
[20:08:26]  Argument of type 'Date' is not assignable to parameter of type 'string'.
[20:08:26]  Error at
            /Users/me/projects/migration/myApp/.tmp/pages/depots/details/details.ngfactory.ts:525:166
[20:08:26]  Supplied parameters do not match any signature of call target.
...

It seems like some kind of code error, but they not only do not make any sense, there isn't much information on where exactly that problem is, since welcome.ngfactory.ts is a temporary, generated file. And I do not have nor do I need a rootPage in it. With the beta I did not have these issues and it worked on Android and iOS.
Am I missing something?

Any help would be awesome.
Best regards,
Khalid

@kchat001
Copy link

kchat001 commented Dec 5, 2016

My Ionic info is:

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.1.14
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.46
ios-deploy version: 1.9.0
ios-sim version: 5.0.12
OS: OS X El Capitan
Node Version: v6.4.0
Xcode version: Xcode 7.3.1 Build version 7D1014

@kchat001
Copy link

kchat001 commented Dec 6, 2016

Hi,
just an update to my problem:

These were indeed code issues. It was just confusing to suddenly have such a strict type checking that wasn't there before, as well as the fact that the build result is inconsistent with the ionic serve result, which just works.

Maybe the ionic serve result can be adjusted in the future to behave similarly, so one may not be bitten later on.

@myfirstandoldgithubprofile

I updated node to the latest version and then I got the following message:

[17:54:36] ionic-app-script task: "build"
[17:54:36] Error: "main.dev.ts" and "main.prod.ts" have been deprecated. Please create a new file "main.ts" containing
the content of "main.dev.ts", and then delete the deprecated files. For more information, please see the
default Ionic project main.ts file here:
https://github.com/driftyco/ionic2-app-base/tree/master/src/app/main.ts

So, I created a main.ts file. I made a CTRL C CTRL V from main.dev.ts to main.ts and that's it :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants