# Trying to install Ionic 2 (npm ERR!)

**URL:** <https://forum.ionicframework.com/t/trying-to-install-ionic-2-npm-err/77480>\
**Category:** ionic-v3\
**Created:** [January 26, 2017, 10:56am UTC](https://forum.ionicframework.com/t/trying-to-install-ionic-2-npm-err/77480 "2017-01-26T10:56:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luca94](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@luca94](https://forum.ionicframework.com/u/luca94)\
**Post date:** [January 26, 2017, 10:56am UTC](https://forum.ionicframework.com/t/trying-to-install-ionic-2-npm-err/77480/1 "2017-01-26T10:56:58Z")

</div>

I created a project folder with ionic 2, but when I launch the “ionic serve” command i get this error:

```
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\admin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "ionic:serve" "--" "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world@ ionic:serve script 'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'.
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-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 serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm ERR! Or if that isn't available, 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! C:\Users\admin\Desktop\myapp\npm-debug.log
There was an error serving your Ionic application: There was an error with the spawned command: serve

```

I’ve installed:

- Ionic 2.2.1
- Node.js 6.9.4
- npm 3.10.10
- Cordova 6.5.0  
on a Win10 pc.

I also read other similar problems: I tried other versions of the listed softwares but no combination has solved the problem.

Does anyone know how to fix?

---

<div class="post-metadata">

**Author:** ![anton\_klochko](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@anton\_klochko](https://forum.ionicframework.com/u/anton_klochko)\
**Post date:** [January 26, 2017, 11:02am UTC](https://forum.ionicframework.com/t/trying-to-install-ionic-2-npm-err/77480/2 "2017-01-26T11:02:43Z")

</div>

**luca94** , try this package.json …

```
{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "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-rc.6",
    "ionic-native": "2.2.12",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "sw-toolbox": "3.4.0",
    "zone.js": "0.6.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.0.0",
    "typescript": "2.0.9"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-console",
    "cordova-plugin-statusbar",
    "cordova-plugin-device",
    "cordova-plugin-splashscreen",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [],
  "description": "myApp_2016_11_22: An Ionic project"
}
```

---

<div class="post-metadata">

**Author:** ![luca94](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@luca94](https://forum.ionicframework.com/u/luca94)\
**Post date:** [January 26, 2017, 12:28pm UTC](https://forum.ionicframework.com/t/trying-to-install-ionic-2-npm-err/77480/3 "2017-01-26T12:28:30Z")

</div>

Ok, with that package.json and launching:

```
> npm install @ionic/app-scripts@latest --save-dev
> npm rebuild node-sass

```

I get `dev server running: http://localhost:8100/`

…But… Now I have this error…

> Runtime Error  
> Module build failed: Error: ENOENT: no such file or directory, open ‘C:\Users\admin\Desktop\myapp\src\app\main.js’ at Error (native)

> Error: Module build failed: Error: ENOENT: no such file or directory, open ‘C:\Users\admin\Desktop\myapp\src\app\main.js’  
> at Error (native)  
> at Object. ([http://localhost:8100/build/main.js:73:7](http://localhost:8100/build/main.js:73:7))  
> at **webpack\_require** ([http://localhost:8100/build/main.js:20:30](http://localhost:8100/build/main.js:20:30))  
> at [http://localhost:8100/build/main.js:66:18](http://localhost:8100/build/main.js:66:18)  
> at [http://localhost:8100/build/main.js:69:10](http://localhost:8100/build/main.js:69:10)

---

<div class="post-metadata">

**Author:** ![Nereus](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nereus/32/105574_2.png) [@Nereus](https://forum.ionicframework.com/u/Nereus)\
**Post date:** [January 26, 2017, 1:37pm UTC](https://forum.ionicframework.com/t/trying-to-install-ionic-2-npm-err/77480/4 "2017-01-26T13:37:04Z")

</div>

Not sure, but think I fixed mine when updating my app-scripts by just deleting node\_modules and run  
`npm install`

---

<div class="post-metadata">

**Author:** ![luca94](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@luca94](https://forum.ionicframework.com/u/luca94)\
**Post date:** [January 26, 2017, 2:03pm UTC](https://forum.ionicframework.com/t/trying-to-install-ionic-2-npm-err/77480/5 "2017-01-26T14:03:06Z")

</div>

done, but didn’t solve 😞
