Я получил эту ошибку, когда сделал npm run dev
, и я установил последнюю версию react / react-dom глобально на моем p c и локально в этом проекте.
Что можно сделать, чтобы исправить этот вопрос?
macbookpro@MacBookProdeMacBook-Pro 01.webpack-base % npm run dev
> 01.webpack-base@1.0.0 dev /Users/macbookpro/Desktop/01.webpack-base
> webpack-dev-server --open
internal/modules/cjs/loader.js:985
throw err;
^
Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
Require stack:
- /Users/macbookpro/node_modules/_html-webpack-plugin@4.3.0@html-webpack-plugin/lib/child-compiler.js
- /Users/macbookpro/node_modules/_html-webpack-plugin@4.3.0@html-webpack-plugin/lib/cached-child-compiler.js
- /Users/macbookpro/node_modules/_html-webpack-plugin@4.3.0@html-webpack-plugin/index.js
- /Users/macbookpro/Desktop/01.webpack-base/webpack.config.js
- /usr/local/lib/node_modules/webpack-cli/bin/utils/convert-argv.js
- /usr/local/lib/node_modules/webpack-dev-server/bin/webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/Users/macbookpro/node_modules/_html-webpack-plugin@4.3.0@html-webpack-plugin/lib/child-compiler.js:14:28)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/macbookpro/node_modules/_html-webpack-plugin@4.3.0@html-webpack-plugin/lib/child-compiler.js',
'/Users/macbookpro/node_modules/_html-webpack-plugin@4.3.0@html-webpack-plugin/lib/cached-child-compiler.js',
'/Users/macbookpro/node_modules/_html-webpack-plugin@4.3.0@html-webpack-plugin/index.js',
'/Users/macbookpro/Desktop/01.webpack-base/webpack.config.js',
'/usr/local/lib/node_modules/webpack-cli/bin/utils/convert-argv.js',
'/usr/local/lib/node_modules/webpack-dev-server/bin/webpack-dev-server.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! 01.webpack-base@1.0.0 dev: `webpack-dev-server --open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the 01.webpack-base@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/macbookpro/.npm/_logs/2020-05-27T09_15_12_766Z-debug.log