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

Cannot find module 'uglifyjs-webpack-plugin'

Open navalgandhi1989 opened this issue 8 years ago • 16 comments

Versions 1.6.6

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.6.6
Node: 6.11.2
OS: win32 x64
Angular: 5.2.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.6
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.6
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0

Repro steps

  • ng new sample
  • cd sample
  • ng serve

Observed behavior

 ng serve
Cannot find module 'uglifyjs-webpack-plugin'
Error: Cannot find module 'uglifyjs-webpack-plugin'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (D:\sample\node_modules\@angular\cli\models\webpack-configs\production.js:13:24)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (D:\sample\node_modules\@angular\cli\models\webpack-configs\index.js:9:10)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)

Desired behavior

First, I expect this simple project to run. Then I would expect to run ng build --prod on another project

Mention any other details that might be useful (optional)

navalgandhi1989 avatar Jan 29 '18 20:01 navalgandhi1989

I am also getting same error...

ashfaqch avatar Jan 29 '18 20:01 ashfaqch

+1

raphaelLacerda avatar Jan 29 '18 20:01 raphaelLacerda

same... :(

chadbr avatar Jan 29 '18 20:01 chadbr

ditto :(

seekheart avatar Jan 29 '18 20:01 seekheart

+1. https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/217

goodmase avatar Jan 29 '18 20:01 goodmase

Dupe #9427

admosity avatar Jan 29 '18 20:01 admosity

+1, can confirm, it happened to me

ianseyer avatar Jan 29 '18 20:01 ianseyer

+1

Same here

ghost avatar Jan 29 '18 20:01 ghost

Duplicate of #9427

hansl avatar Jan 29 '18 20:01 hansl

I've been trying to figure this problem out for about an hour, now. I have uninstalled angular and reinstalled it. I wasn't having this issue earlier and have no idea what could have changed that would cause me to run into this now. Any help would be awesome.

jringwood avatar Jan 29 '18 21:01 jringwood

+1

Was not having this issue approx 4 or 5 hours ago.

ghost avatar Jan 29 '18 21:01 ghost

Check the version of uglifyjs-webpack-plugin you are using in your package.json. I was using 1.1.7 which broke my build a few hours ago, however, after installing the latest version via npm install --save uglifyjs-webpack-plugin It upgraded to 1.1.8 and now my build is fine...

Also see This post

ehthind avatar Jan 29 '18 21:01 ehthind

I use 1.2.7 but I'm getting this error. I'm not creating a new one though. I tried removing node_modules and package-lock.json, to no avail.

"@angular-devkit/build-angular": "^0.6.8", "@angular/cli": "^6.0.8", "@angular/compiler-cli": "^5.2.0", "@angular/language-service": "^5.2.0", "uglifyjs-webpack-plugin": "^1.2.7"

https://github.com/jonasarcangel/ModuleIssue/tree/master/ClientApp.

jonasarcangel avatar Jul 08 '18 09:07 jonasarcangel

yes is wright

shn923 avatar May 06 '19 09:05 shn923

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.