weex-frame icon indicating copy to clipboard operation
weex-frame copied to clipboard

build报错

Open weiliang-Zhang opened this issue 7 years ago • 17 comments

您好,下载了项目,执行完npm run build之后,提示错误:

ERROR in ./src/entry/App.js?entry=true
Module not found: Error: Cannot resolve module '..App.vue' in F:\linkpal\weexProject\weex-frame-master\src\entry
 @ ./src/entry/App.js?entry=true 8:12-33

ERROR in ./src/entry/components/osc-navbar.js?entry=true
Module not found: Error: Cannot resolve module '....componentsosc-navbar.vue' in F:\linkpal\weexProject\weex-frame-m

aster\src\entry\components @ ./src/entry/components/osc-navbar.js?entry=true 8:12-54

ERROR in ./src/entry/components/osc-navpage.js?entry=true
Module not found: Error: Cannot resolve module '....componentsosc-navpage.vue' in F:\linkpal\weexProject\weex-frame-

master\src\entry\components @ ./src/entry/components/osc-navpage.js?entry=true 8:12-55

ERROR in ./src/entry/components/osc-root.js?entry=true
Module not found: Error: Cannot resolve module '....componentsosc-root.vue' in F:\linkpal\weexProject\weex-frame-mas

ter\src\entry\components @ ./src/entry/components/osc-root.js?entry=true 8:12-52

ERROR in ./src/entry/components/osc-tabbar.js?entry=true
Module not found: Error: Cannot resolve module '....componentsosc-tabbar.vue' in F:\linkpal\weexProject\weex-frame-m

aster\src\entry\components @ ./src/entry/components/osc-tabbar.js?entry=true 8:12-54

ERROR in ./src/entry/views/home/app.js?entry=true
Module not found: Error: Cannot resolve module '......iewshomeapp.vue' in F:\linkpal\weexProject\weex-frame-master\

src\entry\views\home @ ./src/entry/views/home/app.js?entry=true 8:12-50

ERROR in ./src/entry/components/osc-tabitem.js?entry=true
Module not found: Error: Cannot resolve module '....componentsosc-tabitem.vue' in F:\linkpal\weexProject\weex-frame-

master\src\entry\components @ ./src/entry/components/osc-tabitem.js?entry=true 8:12-55

ERROR in ./src/entry/views/launch/app.js?entry=true
Module not found: Error: Cannot resolve module '......iewslaunchapp.vue' in F:\linkpal\weexProject\weex-frame-maste

r\src\entry\views\launch @ ./src/entry/views/launch/app.js?entry=true 8:12-52

ERROR in ./src/entry/views/mine/app.js?entry=true
Module not found: Error: Cannot resolve module '......iewsmineapp.vue' in F:\linkpal\weexProject\weex-frame-master\

src\entry\views\mine @ ./src/entry/views/mine/app.js?entry=true 8:12-50

ERROR in ./src/entry/views/web/app.js?entry=true
Module not found: Error: Cannot resolve module '......iewswebapp.vue' in F:\linkpal\weexProject\weex-frame-master\s

rc\entry\views\web @ ./src/entry/views/web/app.js?entry=true 8:12-49

我是先下载项目,解压,执行npm install,然后npm run build,请问是哪一步出错了吗?

weiliang-Zhang avatar Mar 23 '17 07:03 weiliang-Zhang

我这边没问题呀,你先执行下 npm run dev 试试呢

walid1992 avatar Mar 23 '17 10:03 walid1992

我也是这个问题。

qq 20170325215027

quhw avatar Mar 25 '17 13:03 quhw

应该是有两个问题,getEntryFileContent这个方法:

  1. windows下面路径分隔符是\的问题,....\,没有转义,好像用posix可以吧;
  2. Vue.component('osc-root', require("components/osc-root")),这段,是不是component的路径没有给相对路径啊。

我不懂前端这些,看webpack处理的文件错误好像就是这个意思。

quhw avatar Mar 25 '17 15:03 quhw

嗯,第一个问题可能存在,第二个问题不存在,因为webpack配置了别名所以没问题的

walid1992 avatar Mar 25 '17 16:03 walid1992

嗯,我这边测试也是getEntryFileContent这个方法出了问题,但是不太清楚这里应该怎么改,改了就会破坏原来程序的结构

weiliang-Zhang avatar Mar 27 '17 02:03 weiliang-Zhang

windows 的问题,稍后解决吧,多谢大家的支持

walid1992 avatar Mar 28 '17 06:03 walid1992

windows 的问题,希望作者能够尽快解决一下。急急急。

wzwgithubw avatar Mar 30 '17 06:03 wzwgithubw

windows下,getEntryFileContent 方法加入这句话 relativePath = relativePath.replace(/[\]/g, '/'); 可以编译通过。。。

sunflowerlb avatar Mar 31 '17 09:03 sunflowerlb

感谢指点,加入 relativePath=relativePath.replace(/\/ig,'/'); 后编译通过,可以正常运行

weiliang-Zhang avatar Apr 10 '17 08:04 weiliang-Zhang

感谢指点,加入 relativePath=relativePath.replace(/\/ig,'/'); 后编译通过,可以正常运行

应该两个右斜杠。 relativePath=relativePath.replace(/\\/ig,'/');

但是会出现另外一个错误,怎么解决呢?@Lily233 ERROR in ./src/utils/modules/navigator.js Module not found: Error: Cannot resolve 'file' or 'directory' D:\project\front\weex\weex-frame\weex-frame-master\config in D:\project\front\weex\weex-frame\weex-frame-master\src\utils\modules @ ./src/utils/modules/navigator.js 17:14-31

fallowu avatar Apr 10 '17 14:04 fallowu

@fallowu 有些文件找不到,你对着错误检查一下文件位置,基本上是import时的写法,windows下“./"表示当前文件之类的,全部改好就好了,貌似这种错误挺多的

weiliang-Zhang avatar Apr 13 '17 06:04 weiliang-Zhang

@Lily233 谢谢。我重启电脑后就好了,不需要改,不重启一直都有。

fallowu avatar Apr 17 '17 00:04 fallowu

这问题有谁解决了么

xiaogaofudao avatar Apr 28 '17 08:04 xiaogaofudao

将./src/utils/modules/navigator.js里面的第8行的 import ip from 'config' 改为 import ip from 'ip' 就好了 @fallowu

SPACEX-2022 avatar Jun 01 '17 02:06 SPACEX-2022

谢谢!

在 2017-06-01 10:12:42,"540240126" [email protected] 写道:

将./src/utils/modules/navigator.js里面的第8行的 import ip from 'config' 改为 import ip from 'ip' 就好了 @fallowu

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

weiliang-Zhang avatar Jun 05 '17 02:06 weiliang-Zhang

怎么一直报错

shy19940217 avatar Jun 15 '17 07:06 shy19940217

求解啊

shy19940217 avatar Jun 15 '17 07:06 shy19940217