[SOVLED] Cannot find module './app.module.ngfactory' on npm run build


Hey all,

Tried to build for ios and android this morning, and it seems to have broken after updating to ionic-app-scripts @ latest.

$ npm run build

> health.com.au@ build /Users/Harley/Apps/health-app
> ionic-app-scripts build

[11:41:04]  ionic-app-scripts 0.0.42
[11:41:04]  build prod started ...
[11:41:04]  clean started ...
[11:41:04]  clean finished in 37 ms
[11:41:04]  copy started ...
[11:41:05]  ngc started ...
[11:41:05]  copy finished in 1.31 s
[11:41:21]  Error: Error at /Users/Harley/Apps/health-app/.tmp/app/main.prod.ts:4:36
[11:41:21]  Cannot find module './app.module.ngfactory'.
[11:41:21]  ngc failed
[11:41:21]  ionic-app-script task: "build"
[11:41:21]  Error: Error

npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/Harley/.nvm/versions/node/v6.9.1/bin/node" "/Users/Harley/.nvm/versions/node/v6.9.1/bin/npm" "run" "build"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! health.com.au@ build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the health.com.au@ build script 'ionic-app-scripts build'.
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 health.com.au 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 information on how to open an issue for this project with:
npm ERR!     npm bugs health.com.au
npm ERR! Or if that isnt available, you can get their info via:
npm ERR!     npm owner ls health.com.au
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Harley/Apps/health-app/npm-debug.log

$ ionic info

Your system information:

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.2
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v6.9.1
Xcode version: Xcode 8.1 Build version 8B62

Just updated to RC2, here are the deps in package.json

"dependencies": {
    "@angular/common": "2.1.1",
    "@angular/compiler": "2.1.1",
    "@angular/compiler-cli": "2.1.1",
    "@angular/core": "2.1.1",
    "@angular/forms": "2.1.1",
    "@angular/http": "2.1.1",
    "@angular/platform-browser": "2.1.1",
    "@angular/platform-browser-dynamic": "2.1.1",
    "@angular/platform-server": "2.1.1",
    "@ionic/cloud-angular": "^0.7.0",
    "@ionic/storage": "1.1.2",
    "express": "^4.14.0",
    "ionic-angular": "2.0.0-rc.2",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "lodash": "^4.16.2",
    "moment": "^2.15.1",
    "raven-js": "^3.7.0"

Tried deleting the .tmp folder, stopping ionic serve, etc.

Super confused as to why this stopped working all of a sudden! Any help appreciated.


delete node_modules & $ npm install again solved this.