Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'google-closure-compiler/lib/utils' #157

Closed
luqven opened this issue Feb 22, 2021 · 1 comment
Closed

Error: Cannot find module 'google-closure-compiler/lib/utils' #157

luqven opened this issue Feb 22, 2021 · 1 comment

Comments

@luqven
Copy link

luqven commented Feb 22, 2021

Error:

  • Trying to transition over from webpack-closure-compiler.
  • I deleted my node modules and re-installed using:
    • npm install --save-dev closure-webpack-plugin google-closure-compiler
  • The google-closure-compiler package that's listed in the README install script does not have this directory in
    • node_modules/google-closure-compiler/lib
  • The file trying to access it is /closure-webpack-plugin/src/closure-compiler-plugin.js on lines 5-8.

Why is this plugin trying to access a directory that does not exist in it's required dependency? Is there a fix that I can rollback to?

Any help much appreciated.

Failed to load '/Users/Luis/Documents/libraries/webpack.config.js'
[webpack-cli] Error: Cannot find module 'google-closure-compiler/lib/utils'
Require stack:
- /Users/Luis/Document/libraries/node_modules/closure-webpack-plugin/src/closure-compiler-plugin.js
- /Users/Luis/Documents/libraries/webpack.config.js
- /Users/Luis/Documents/libraries/node_modules/webpack-cli/lib/webpack-cli.js
- /Users/Luis/Documents/libraries/node_modules/webpack-cli/lib/bootstrap.js
- /Users/Luis/Documents/libraries/node_modules/webpack-cli/bin/cli.js
- /Users/Luis/Documents/libraries/node_modules/webpack/bin/webpack.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (/Users/Luis/Documents/libraries/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/Users/Luis/Documents/libraries/node_modules/closure-webpack-plugin/src/closure-compiler-plugin.js:8:5)
    at Module._compile (/Users/Luis/Documents/libraries/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/Luis/Documents/libraries/node_modules/closure-webpack-plugin/src/closure-compiler-plugin.js',
    '/Users/Luis/Documents/libraries/webpack.config.js',
    '/Users/Luis/Documents/libraries/node_modules/webpack-cli/lib/webpack-cli.js',
    '/Users/Luis/Documents/libraries/node_modules/webpack-cli/lib/bootstrap.js',
    '/Users/Luis/Documents/libraries/node_modules/webpack-cli/bin/cli.js',
    '/Users/Luis/Documents/libraries/node_modules/webpack/bin/webpack.js'
  ]
}
@luqven
Copy link
Author

luqven commented Feb 26, 2021

For anyone who stumbled on this, changing the package.json versions from closure-webpack-plugin": "2.5.0"" to ^2.5.0 fixed this for me.

@luqven luqven closed this as completed Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant