使用npm run dev运行项目出错
项目模板未进行任何修改
终端提示:
> element-starter@ dev /Users/buduan/Documents/HBuilderProjects/ele
> webpack-dev-server --inline --hot --env.dev
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module '../lib/polyfills'
Require stack:
- /Users/buduan/Documents/HBuilderProjects/ele/node_modules/.bin/webpack-dev-server
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/Users/buduan/Documents/HBuilderProjects/ele/node_modules/.bin/webpack-dev-server:6:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/buduan/Documents/HBuilderProjects/ele/node_modules/.bin/webpack-dev-server'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! element-starter@ dev: `webpack-dev-server --inline --hot --env.dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the element-starter@ 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/buduan/.npm/_logs/2020-10-16T15_34_39_536Z-debug.log
本人环境:
Mac OS Big Sur
NPM 6.14.8
Node 14.14.0
3***@qq.com
我也遇到了,然后我只想了 npm install polyfills,安装了这个之后,再运行 npm run dev 错误依然存在,卡在这里两天了,这个究竟应该怎么解决啊?
2021-05-27 14:03