walid1992 / weex-frame

weex 基于vue2.0开发框架
433 stars 121 forks source link

build报错 #4

Open weiliang-Zhang opened 7 years ago

weiliang-Zhang commented 7 years ago

您好,下载了项目,执行完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,请问是哪一步出错了吗?

walid1992 commented 7 years ago

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

quhw commented 7 years ago

我也是这个问题。

qq 20170325215027

quhw commented 7 years ago

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

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

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

walid1992 commented 7 years ago

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

weiliang-Zhang commented 7 years ago

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

walid1992 commented 7 years ago

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

wzwgithubw commented 7 years ago

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

sunflowerlb commented 7 years ago

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

weiliang-Zhang commented 7 years ago

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

fallowu commented 7 years ago

感谢指点,加入 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

weiliang-Zhang commented 7 years ago

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

fallowu commented 7 years ago

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

xiaogaofudao commented 7 years ago

这问题有谁解决了么

SPACEX-2022 commented 7 years ago

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

weiliang-Zhang commented 7 years ago

谢谢!

在 2017-06-01 10:12:42,"540240126" notifications@github.com 写道:

将./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.

shy19940217 commented 7 years ago

怎么一直报错

shy19940217 commented 7 years ago

求解啊