user1902183
user1902183

Reputation: 3377

Angular2 AOT compiler keeps asking for Name

Is there a reason (that I can fix) why when I do:

ngc -p tsconfig.aot.json

That in response, it asks for:

Name:

It seems that the ngc simply ignores my tsconfig.aot.json.

What could be the reason for this?

Thanks!

Upvotes: 4

Views: 409

Answers (2)

Ignatius Andrew
Ignatius Andrew

Reputation: 8258

NPM is confused between the Component generator package called as ngc, So uninstall it, then AOT build will go on smooth

npm uninstall ngc -g

then in your package.json make an entry

 "scripts": {
    "ngc": "node_modules/.bin/ngc -p ./tsconfig-aot.json",
    "start": "npm run ngc && webpack-dev-server --inline --config config/webpack.dev.js --progress --port 3000",
    "webpack": "npm run ngc && webpack --config config/webpack.dev.js",

Upvotes: 3

Jay
Jay

Reputation: 711

  1. Check your package.json , remove the any 'ngc' module references.
  2. Clean your node_modules folder
  3. Re-install the required angular-cli modules

Above three steps should solve the issue.

Upvotes: 1

Related Questions