Skip to content

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

Closed

Description

@elvisbegovic

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

Activity

  1. filipesilva commented on Jun 7, 2018

    @filipesilva
    Contributor

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

  2. filipesilva commented on Jun 7, 2018

    @filipesilva
    Contributor

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

  3. filipesilva commented on Jul 6, 2018

    @filipesilva
    Contributor

    I think everything here is now fixed.

  4. Seh83 commented on Nov 13, 2018

    @Seh83

    Try this...

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

  5. gtzinos commented on Nov 20, 2018

    @gtzinos

    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

  6. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    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.

  7. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions