一、报错
ERRORFailed to compile with 1 error
errorin ./src/components/tools/DynamicNotice.vue
Syntax Error: TypeError: Cannot read property 'range' of null0ccurred while linting DynamicNotice.vue:22
at Array.forEach (<anonymous>)
at Array.forEach (<anonymous>)
at Array.map (<anonymous>)
a,/node modu es/cache- oader/dst/cis,is??nef--12-0../node moduleshabe -loader/lib!.node modules/cache--oader/dist8:19-
看报错行代码,没有任何头绪,百度
return () => import(`@/views/Home.vue`)
二、解决
找到package.json修改版本,一开始是10.0.1的版本,然后修改的7.2.3的版本,没用。
在运行时,控制台有输出警告:warning babel-eslint@7.2.3: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
注释掉babel-eslint所在行。
再次运行,控制台打印非常多的报错和警告
执行命令,修复错误和告警:
eslint --fix src/
三、项目访问
启动成功后,登录时在用户名和密码正确的情况下返回token验证失败。想了一下应该是配置访问地址出了问题。
找到配置项目地址的地方,果然全局配置的所有地址都注释掉了,恢复注释,重新运行,然后正常访问。提交修改。
神奇的是同事也是拉取的代码,一次运行成功,什么问题都没有,离谱。