b***@qq.com
b***@qq.com
  • 发布:2020-10-16 23:37
  • 更新:2020-12-25 11:54
  • 阅读:1454

使用Hbuilder创建的element-starter运行出错

分类:HBuilder

使用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

2020-10-16 23:37 负责人:无 分享
已邀请:
DCloud_HB_WDL

DCloud_HB_WDL

提示已经很明确了,请根据提示解决

  • 3***@qq.com

    我也遇到了,然后我只想了 npm install polyfills,安装了这个之后,再运行 npm run dev 错误依然存在,卡在这里两天了,这个究竟应该怎么解决啊?

    2021-05-27 14:03

w***@sina.com

w***@sina.com

先yarn 然后再npm run dev

  • 3***@qq.com

    具体是怎么操作的? yarn?

    2021-05-27 14:04

[已删除]

[已删除]

承接H5、小程序、APP等外包:

  1. 经验丰富,做过多种类型项目,有案例可看;
  2. 开发流程、目录搭建、代码都很规范(二次开发也很容易上手);
  3. 整个项目外包可以找我(小团队接单,面向客户、产品);
  4. 只需要前端部分也可以找我(个人接单,面向服务端合作伙伴);
  5. wechat、tel(13070273424);

该问题目前已经被锁定, 无法添加新回复