cannot find module css-loader while doing ng build -prod with angular-cli@1.0.0-beta.21

前端 未结 6 1321
逝去的感伤
逝去的感伤 2021-02-02 01:12

I have following package.json configuration

\"dependencies\": {
\"@angular/common\": \"2.2.1\",
\"@angular/compiler\": \"2.2.1\",
\"@angular/core\": \"2.2.1\",
\         


        
相关标签:
6条回答
  • 2021-02-02 01:38

    had the same issue starting today.

    The solution I found was to change the angular-cli dependency in package.json file to "1.0.0-beta.19-3" and reinstall the npm packages.

    {
      "devDependencies": {
           ...
           "angular-cli": "1.0.0-beta.19-3",
           ...
           }
    }
    

    Hope this helps!

    0 讨论(0)
  • 2021-02-02 01:41

    mkishorem is right.

    I also got same error and fix with adding override code at package.json like below

    "devDependencies": {
     "extract-text-webpack-plugin": "2.0.0-beta.5" 
     }
    

    no need to downgrading to angular-cli all.

    0 讨论(0)
  • 2021-02-02 01:45

    Update to @angular/* 2.3.1 version

    0 讨论(0)
  • 2021-02-02 01:48

    Thanks to Florinache!

    Downgrading to angular-cli "1.0.0-beta.19-3" works for me. I had the same issue from today on in all my projects...

    {
      "devDependencies": {
           ...
           "angular-cli": "1.0.0-beta.19-3",
           ...
       }
    }
    
    0 讨论(0)
  • 2021-02-02 01:53

    I have got the same issue as you. As a temporary solution I changed to 'ng build --dev'. Using this command the loader uses webpack-build-development.js instead of webpack-build-production.js and gets 'css-loader?sourcemap' instead of 'css-loader?sourcemap&minimize'.

    0 讨论(0)
  • 2021-02-02 01:58

    It looks like extract-text-webpack-plugin is upgraded to RC, Try overriding the extract-text-webpack-plugin version to "2.0.0-beta.4" in your package.json.

    0 讨论(0)
提交回复
热议问题