angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng serve fails

Open norbert-tasi opened this issue 8 years ago • 6 comments

I got this error and cannot serve:

ERROR in multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts Module not found: Error: Can't resolve '@ngtools/webpack' in 'c:\development\apa\frontend\apamanger' ERROR in multi ./src/polyfills.ts Module not found: Error: Can't resolve '@ngtools/webpack' in 'c:\development\apa\frontend\apamanger'

Versions

Node: 9.7.1
OS: win32 x64
Angular: 6.0.0-rc.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 6.0.0-rc.0
@angular-devkit/architect: 0.5.0
@angular-devkit/build-angular: 0.0.10
@angular-devkit/build-optimizer: 0.4.9
@angular-devkit/core: 0.5.0
@angular-devkit/schematics: 0.5.0
@ngtools/json-schema: 1.1.0
@schematics/angular: 0.5.0
@schematics/update: 0.5.0
typescript: 2.7.2
webpack: 4.1.0
<!--
Output from: `ng --version`.
If nothing, output from: `node --version` and `npm --version`.
  Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)
-->

Repro steps

  • Step 1
  • Step 2
  • Step 3

Observed behavior

<!-- Normally this includes a stack trace and some more information. -->

Desired behavior

Mention any other details that might be useful (optional)

norbert-tasi avatar Apr 04 '18 15:04 norbert-tasi

This appears to be a bug but we will need to look at a reproduction to find and fix the problem. Can you setup a minimal reproduction please?

You can read here why this is needed. A good way to make a minimal reproduction 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.

clydin avatar Apr 04 '18 18:04 clydin

Thank you for your quick reply. I've created the repo: https://github.com/norbert-tasi/ngissue I could manage to reproduce it easily.

  1. create new app
  2. yarn

I've tried yarn cache clean, reinstall, but fails.

ERROR in multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts Module not found: Error: Can't resolve '@ngtools/webpack' in 'c:\development\apa\frontend\ngissue' ERROR in multi ./src/polyfills.ts Module not found: Error: Can't resolve '@ngtools/webpack' in 'c:\development\apa\frontend\ngissue' i 「wdm」: Failed to compile.

norbert-tasi avatar Apr 04 '18 19:04 norbert-tasi

npm install resolved this issue.

norbert-tasi avatar Apr 04 '18 19:04 norbert-tasi

Closing as resolved.

clydin avatar Apr 05 '18 14:04 clydin

got the same error. npm install indeed helped however imho yarn should work.

MartinNuc avatar Apr 13 '18 21:04 MartinNuc

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.