Ngc: can't resolve module @angular/common


#1

When I upgraded my ionic rc4 app to rc0 using the edit current files method and running “ionic build android” shows some error:

Running ‘build:before’ npm script before build

kudoswall@ build /Users/wds/SAJITH/ionic-projects/kudoswall-rc0
ionic-app-scripts build
[17:49:47] ionic-app-scripts 0.0.30
[17:49:47] build prod started …
[17:49:47] clean started …
[17:49:47] clean finished in 17 ms
[17:49:47] copy started …
[17:49:47] ngc started …
[17:49:47] lint started …
[17:49:48] copy finished in 926 ms
[17:49:50] tslint: /Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/tslint/lib/configuration.js:134
throw new Error(("Invalid “extends” configuration value - could not require “” + filePath + “”. ") +
^

Error: Invalid “extends” configuration value - could not require “tslint-ionic-rules”. Review the Node lookup algorithm (https://nodejs.org/api/modules.html#modules_all_together) for the approximate method TSLint uses to find the referenced configuration file.
at resolveConfigurationPath (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/tslint/lib/configuration.js:134:19)
at loadConfigurationFromPath (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/tslint/lib/configuration.js:105:38)
at Object.findConfiguration (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/tslint/lib/configuration.js:47:12)
at processFile (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/tslint/lib/tslint-cli.js:131:41)
at /Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/tslint/lib/tslint-cli.js:177:74
at Array.forEach (native)
at Object. (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/tslint/lib/tslint-cli.js:177:41)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)

[17:49:50] lint finished in 3.59 s
[17:50:02] ngc: can’t resolve module @angular/common from /Users/wds/SAJITH/ionic-projects/kudoswall-rc0/.tmp/pages/profile-page/profile-page.ts

[17:50:02] ngc: Error: can’t find symbol FormBuilder exported from module /Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/@angular/common/index.d.ts, resolving symbol ProfilePage in /Users/wds/SAJITH/ionic-projects/kudoswall-rc0/.tmp/pages/profile-page/profile-page.ts
at simplifyInContext (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/@angular/compiler-cli/src/static_reflector.js:469:23)
at StaticReflector.simplify (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/@angular/compiler-cli/src/static_reflector.js:472:22)
at StaticReflector.parameters (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/@angular/compiler-cli/src/static_reflector.js:102:47)
at CompileMetadataResolver.getDependenciesMetadata (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/@angular/compiler/bundles/compiler.umd.js:14204:56)
at CompileMetadataResolver.getTypeMetadata (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/@angular/compiler/bundles/compiler.umd.js:14169:28)
at /Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/@angular/compiler/bundles/compiler.umd.js:14312:43
at Array.forEach (native)
at CompileMetadataResolver.getProvidersMetadata (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/@angular/compiler/bundles/compiler.umd.js:14292:21)
at CompileMetadataResolver.getDirectiveMetadata (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/@angular/compiler/bundles/compiler.umd.js:13932:36)
at /Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/@angular/compiler/bundles/compiler.umd.js:14348:35
Compilation failed

[17:50:02] Failed on type {“filePath”:"/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/.tmp/pages/profile-page/profile-page.ts",“name”:“ProfilePage”} with error Error: can’t find symbol FormBuilder exported from module /Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/@angular/common/index.d.ts, resolving symbol ProfilePage in /Users/wds/SAJITH/ionic-projects/kudoswall-rc0/.tmp/pages/profile-page/profile-page.ts
[17:50:02] ngc failed: NGC encountered an error

[17:50:02] Error: NGC encountered an error
at ChildProcess. (/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/node_modules/@ionic/app-scripts/dist/ngc.js:62:24)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

Error running ionic app script “build”: Error: NGC encountered an error

npm
ERR! Darwin 16.0.0
npm ERR!
argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” "build"
npm
ERR! node v6.8.0
npm
ERR! npm v3.10.8
npm
ERR! code ELIFECYCLE
npm
ERR! kudoswall@ build: ionic-app-scripts build
npm ERR!
Exit status 1
npm ERR!

npm ERR! Failed at the kudoswall@ 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 kudoswall 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 kudoswall
npm ERR!
Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls kudoswall
npm
ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!
/Users/wds/SAJITH/ionic-projects/kudoswall-rc0/npm-debug.log

Caught exception:
undefined

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