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

thrown error: cannot find module 'webpack/lib/NormalModule' when building #524

Open
vinceLJ opened this issue Apr 15, 2020 · 1 comment
Open

Comments

@vinceLJ
Copy link

vinceLJ commented Apr 15, 2020

Expected Behavior

build successfully.

Actual Behavior

building failed. error is reported below

Is an error being thrown?

Error: Cannot find module 'webpack/lib/NormalModule'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (C:\Users\Administrator\AppData\Roaming\npm\node_modules\webpack-
cli\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at Object. (D:\svn\jhtmp\node_modules\hard-source-webpack-plugin
lib\TransformNormalModulePlugin.js:1:84)
at Module._compile (C:\Users\Administrator\AppData\Roaming\npm\node_modules
webpack-cli\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (C:\Users\Administrator\AppData\Roaming\npm\node_modules\webpack-
cli\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at HardSourceWebpackPlugin.apply (D:\svn\jhtmp\node_modules\hard-source-webp
ack-plugin\index.js:430:41)
at webpack (C:\Users\Administrator\AppData\Roaming\npm\node_modules\webpack
lib\webpack.js:51:13)
at processOptions (C:\Users\Administrator\AppData\Roaming\npm\node_modules\w
ebpack-cli\bin\cli.js:272:16)
at yargs.parse (C:\Users\Administrator\AppData\Roaming\npm\node_modules\webp
ack-cli\bin\cli.js:364:3)
at Object.parse (C:\Users\Administrator\AppData\Roaming\npm\node_modules\web
pack-cli\node_modules\yargs\yargs.js:567:18)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules\webpack-cli\bin\c
li.js:49:8
at Object. (C:\Users\Administrator\AppData\Roaming\npm\node_modul
es\webpack-cli\bin\cli.js:366:3)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\Administrator\AppData\Roaming\npm\node_modul
es\webpack\bin\webpack.js:156:2)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)

Steps to Reproduce

  • In my webpack.config.js:
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
module.exports = {
    entry: ...,
    output: ...,
    module: ...,
    plugins: [
        new HardSourceWebpackPlugin()
    ]
};
  • Any other information you find helpful reproducing an issue
    I use 'webpack --mode development' to build.

Operating System, Node, and NPM dependency versions

windows 7
Node 8.11.4
npm 6.4.0
"devDependencies": {
  "babel-core": "^7.9.0",
  "babel-loader": "^8.1.0",
  "babel-preset-env": "^7.9.5",
  "css-loader": "^3.5.1",
  "style-loader": "^1.1.3",
  "webpack": "^4.42.1",
  "webpack-cli": "^3.3.11",
  "hard-source-webpack-plugin": "^0.13.1"
},
"dependencies": {
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
}
@blockmood
Copy link

+1

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

2 participants