Alternatively, run 'webpack(-cli) --help' for usage info.
Hash: e040e8aa823a0e30ae4b
Version: webpack 4.41.4
Time: 79ms
Built at: 2019-12-23 19:52:00
ERROR in Entry module not found: Error: Can't resolve './src' in 'E:\HBuilder\Vue\day07\test1'
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! test1@1.0.0 dev: `webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the test1@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! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-12-23T11_52_00_634Z-debug.log
PS E:\HBuilder\Vue\day07\test1> npm i ./src --save
npm ERR! code ENOLOCAL
npm ERR! Could not install from "src" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-12-23T12_02_47_141Z-debug.log
PS E:\HBuilder\Vue\day07\test1> npm i './src' --save
npm ERR! code ENOLOCAL
npm ERR! Could not install from "src" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-12-23T12_03_08_325Z-debug.log
配置好webpack环境后,npm run dev 时报错如上
解决办法:在src 下面创建 index.html 和index.js 文件,再重新运行就能解决。
在使用Webpack进行项目构建时,遇到入口模块未找到的错误,通常是因为src目录下缺少必要的index.html和index.js文件。本文详细介绍了如何通过在src目录下创建这两个文件来解决此问题。
1291

被折叠的 条评论
为什么被折叠?



