Angular-cli: When running ng serve an error occurs: NgTools_InternalApi_NG_2 not found

Created on 14 Sep 2018  路  8Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Node: 8.11.4
NPM: 5.6.0
Angular CLI: 6.2.1

Running ng serve fails.

The log given by the failure

ERROR in node_modules/@angular/compiler-cli/index.d.ts(20,10): error TS2305: Module '"/opt/local/apache2/htdocs/angular-components/angular-project/node_modules/@angular/compiler-cli/src/ngtools_api"' has no exported member 'NgTools_InternalApi_NG_2'.

Desired functionality

It should compile and run the test site successfully.

repro steps

All 8 comments

This error is related to this issue
https://github.com/angular/angular/issues/23112

However this shouldn鈥檛 happen on ng serve.

Can you setup a minimal repro please?

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

This might be related to your directory structure so its really important to get an accurate repro to diagnose this.

Closing as no further feedback received.

If the problem persists, please open a new issue following our submission guidelines.

A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

I am not sure why this is closed since it's clearly a bug. This should be reopened. ngtools_api.d.ts does not have NgTools_InternalApi_NG_2. It creates issue on ng serve & then it disappears when we have any file & code recompiled.

same issue here with

"@angular/compiler": "7.2.0",
"@angular/compiler-cli": "7.2.8",

when running have this error on the console.

Typescript Error
Module '"@angular/compiler-cli/src/ngtools_api"' has no exported member 'NgTools_InternalApi_NG_2'.

Please reopen this issue

Same issue for us

@kirillgroshkov you should remove the @angular/compiler-cli imports. And then it should work perfectly fine again. I my case that was the problem .

@exequielc exactly, realized that just after some more digging. tnx!

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MateenKadwaikar picture MateenKadwaikar  路  3Comments

JanStureNielsen picture JanStureNielsen  路  3Comments

naveedahmed1 picture naveedahmed1  路  3Comments

daBishMan picture daBishMan  路  3Comments

IngvarKofoed picture IngvarKofoed  路  3Comments