欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

npm run dev 报错 ERROR in Entry module not found: Error: Can't resolve './src' in

程序员文章站 2022-07-15 12:45:57
...
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! [email protected] dev: `webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] 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 文件,再重新运行就能解决。

相关标签: Vue Vue