Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'webpack' after moving from @latest to @next #11148

Closed
elvisbegovic opened this issue Jun 7, 2018 · 7 comments
Closed

Cannot find module 'webpack' after moving from @latest to @next #11148

elvisbegovic opened this issue Jun 7, 2018 · 7 comments

Comments

@elvisbegovic
Copy link
Contributor

Bug Report or Feature Request (mark with an x)

- [x] bug report 

Area

- [x] devkit

Versions

nodejs10.4.0
npm6.1.0
Angular CLI: 6.1.0-beta.2
Node: 10.4.0
OS: win32 x64
Angular: 6.1.0-beta.0
... common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.7.0-beta.2 (cli-only)
@angular-devkit/build-angular   0.7.0-beta.2
@angular-devkit/build-webpack   0.7.0-beta.2
@angular-devkit/core            0.7.0-beta.2 (cli-only)
@angular-devkit/schematics      0.7.0-beta.2 (cli-only)
@angular/cdk                    6.2.1
@angular/cli                    6.1.0-beta.2
@angular/material               6.2.1
@schematics/angular             0.7.0-beta.2 (cli-only)
@schematics/update              0.7.0-beta.2 (cli-only)
rxjs                            6.2.0
typescript                      2.7.2

Repro steps

I was in cli 6 and want try ng update --next --all it cancel me cause of peer dependances
ng update --next --all --force success but get me last version of typescrip, I need manually in package.json write ~2.7.2 then npm install

After that I run ng serve and I get :

Cannot find module 'webpack'
Error: Cannot find module 'webpack'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
    at Function.Module._load (internal/modules/cjs/loader.js:520:25)
    at Module.require (internal/modules/cjs/loader.js:650:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (C:\Users\...\node_modules\@angular-devkit\build-webpack\src\webpack\index.js:6:17)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)

Then I remove node_modules manually then rerun npm install -> same error output.

Desired functionality

First of all avoid always update typescript to last version keep only supported version. Then I desire to update easily.

Mention any other details that might be useful

Actually I can't quit this @next and come back to @latest I need fix my package.json manually. Damn!

cc @filipesilva

@filipesilva
Copy link
Contributor

I think that was some badly configured peer dependencies on our side. #11152 should fix it.

@filipesilva
Copy link
Contributor

Getting you the latest TypeScript was fixed by angular/devkit#987

@filipesilva
Copy link
Contributor

I think everything here is now fixed.

@Seh83
Copy link

Seh83 commented Nov 13, 2018

Try this...

npm uninstall --save webpack
npm install --save-dev webpack

@gtzinos
Copy link

gtzinos commented Nov 20, 2018

don't try it, we don't have to install webpack it will break if you will execute

rm -rf node_modules
npm install
ng serve

@brittpoplin
Copy link

I had to delete package-lock.json, then remove and reinstall node_modules.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants