question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'uglifyjs-webpack-plugin'

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
ehthindcommented, Jan 30, 2018

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

2reactions
jringwoodcommented, Jan 29, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

uglifyjs-webpack-plugin - npm
This plugin uses uglify-js to minify your JavaScript. Requirements. This module requires a minimum of Node v6.9.0 and Webpack v4.0.0. Getting ...
Read more >
Unable to find module 'uglifyjs-webpack-plugin', even with ...
I have updated my package.json so that I am using uglifyjs-webpack-plugin 1.2.7. Error: Cannot find module 'uglifyjs-webpack-plugin'.
Read more >
uglifyjs-webpack-plugin - npm.io
This plugin uses uglify-js to minify your JavaScript. Requirements. This module requires a minimum of Node v6.9.0 and Webpack v4.0.0. Getting Started. To...
Read more >
'uglifyjs-webpack-plugin Cannot find module - CSDN
Error: Cannot find module 'fork-ts-checker-webpack-plugin-v5' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module.
Read more >
webpack-cli error cannot find module 'uglifyjs-webpack-plugin'
webpack-cli error cannot find module 'uglifyjs-webpack-plugin'技术、学习、经验文章掘金开发者社区搜索结果。掘金是一个帮助开发者成长的社区,webpack-cli error ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found