Reputation: 227
I upgraded angular to 4 and angular cli to 1.03.
After I run the command npm ls typescript
I get:
+-- @angular/[email protected]
| `-- [email protected]
`-- [email protected] invalid
npm ERR! invalid: [email protected] C:\development\projects-git\mydoc\static-web\node_modules\typescript
What's the difference between the first and the second typescript, why is the second one invalid/how do I fix it?
I think the error above is the reason why I get the error below so I hope there is a fix for both so I can run my application again.
ERROR in AppModule is not an NgModule
ERROR in ./src/main.ts
Module build failed: TypeError: Cannot read property 'newLine' of undefined
at Object.getNewLineCharacter (..\static-web\node_modules\typescript\lib\typescript.js:9580:20)
at Object.createCompilerHost (..\static-web\node_modules\typescript\lib\typescript.js:66674:26)
at Object.ngcLoader (..\static-web\node_modules\@ngtools\webpack\src\loader.js:202:31)
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
Upvotes: 2
Views: 954
Reputation: 184
I had a similar issue where i even had two different typescript versions listed when i did npm ls typescript
.
What's the difference between the first and the second typescript
The first one is listed as a dependency of @angular/cli
, the second one is a dependency of your own project.
why is the second one invalid/how do I fix it?
In my case, i had typescript
defined under both, dependencies
and devDependencies
section in my package.json
.
I removed it from dependencies
and the duplicate output disappeared.
Upvotes: 5