Ionic 2 Final Serve Failed


#1

I went to start a new project using the Ionic 2 final:

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v6.7.0
Xcode version: Xcode 8.2.1 Build version 8C1002

I started a new project, then cd into project folder, then serve I get:
Error: ENOENT: no such file or directory

In the project folder, I run npm install to update node modules and I get
npm WARN @angular/compiler-cli@2.2.1 requires a peer of typescript@^2.0.2 but none was installed.
npm WARN @angular/tsc-wrapped@0.3.0 requires a peer of typescript@^2.0.2 but none was installed.
npm WARN tsickle@0.1.7 requires a peer of typescript@^2.0.0 || ^2.1.0-dev but none was installed.

In the package.json these are the dependencies:
“dependencies”: {
"@angular/common": “2.2.1”,
"@angular/compiler": “2.2.1”,
"@angular/compiler-cli": “2.2.1”,
"@angular/core": “2.2.1”,
"@angular/forms": “2.2.1”,
"@angular/http": “2.2.1”,
"@angular/platform-browser": “2.2.1”,
"@angular/platform-browser-dynamic": “2.2.1”,
"@angular/platform-server": “2.2.1”,
"@ionic/storage": “1.1.7”,
“ionic-angular”: “2.0.0”,
“ionic-native”: “2.4.1”,
“ionicons”: “3.0.0”,
“rxjs”: “5.0.0-beta.12”,
“zone.js”: “0.6.26”,
“sw-toolbox”: “3.4.0”
},
“devDependencies”: {
"@ionic/app-scripts": “1.0.0”,
“typescript”: “2.0.9”
},

Why would typescript not be installed?


#2

Perhaps you have an old version of npm?


#3

I’m using

npm -v
3.10.3

Where would I find the version they recommend?


#4

That doesn’t seem outrageously old enough that it wouldn’t (for example) be able to handle semver dependencies, but my Mac has 3.10.9 and my sid machine has 3.10.10, so you could see if upgrading makes a difference.


#5

You may also try cleaning your npm cache. This is reported to fix some similar-looking issues with angular-cli.


#6

I’m having the same problem, but if using only “serve” instead of “serve -lab” works.


#7

Thanks for the suggestions - I updated npm to 3.10.10 and ran npm cache clean - this did not work.


#8

Now - for some reason - I’m not getting any notification about typescript dependencies not being met.

I can serve the project, but I just get this:
Error: ENOENT: no such file or directory, open '{{myprojectdirectory}}


#9

So lets run through the steps you took…

npm install -g ionic 

> ionic 2.2.1

ionic start myApp --v2
cd myApp
ionic serve

correct?
You’re node and npm version look fine, so I’m not sure what could be the issue. But could you provide some more information?


#10

Updating the ionic cli seemed to work. I think I was running 2.1.0 when I had the issue.

Reinstalling ionic cli 2.2.0 allowed me to serve a project.

Thanks!


#11

I’m use

but not work serve --lab,
any suggestion?