Webpack: Fresh install error (Cannot find module 'uglifyjs-webpack-plugin')

Created on 29 Jan 2018  路  7Comments  路  Source: vuejs-templates/webpack

  1. npm install -g vue-cli
  2. vue init webpack my-project
  3. cd my-project
  4. npm install
  5. npm run build

Error:

> node build/build.js

module.js:544
    throw err;
    ^

Error: Cannot find module 'uglifyjs-webpack-plugin'
    at Function.Module._resolveFilename (module.js:542:15)
    at Function.Module._load (module.js:472:25)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Volumes/HDD/www/einheit/build/webpack.prod.conf.js:12:24)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Volumes/HDD/www/einheit/build/build.js:12:23)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `node build/build.js`
npm ERR! Exit status 1
npm ERR!

src.zip

Most helpful comment

@uonick and @LinusBorg fix was reported here https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/217,

npm update uglifyjs-webpack-plugin
npm run build

worked for me

All 7 comments

Have you tried installing it?

Yes

same error here, digging in this morning but did @uonick find a fix?

@gscottqueen nope 馃槥

Will try to reproduce this tonight, seems very strange.

This is the module: https://www.npmjs.com/package/uglifyjs-webpack-plugin

Here it's defined in package.json: https://github.com/vuejs-templates/webpack/blob/develop/template/package.json#L111

And here it's being imported: https://github.com/vuejs-templates/webpack/blob/develop/template/build/webpack.prod.conf.js#L12

I really don't see where this should break ...

@uonick and @LinusBorg fix was reported here https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/217,

npm update uglifyjs-webpack-plugin
npm run build

worked for me

Thanks!

Was this page helpful?
0 / 5 - 0 ratings