Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build报错 #4

Open
weiliang-Zhang opened this issue Mar 23, 2017 · 17 comments
Open

build报错 #4

weiliang-Zhang opened this issue Mar 23, 2017 · 17 comments

Comments

@weiliang-Zhang
Copy link

weiliang-Zhang commented Mar 23, 2017

您好,下载了项目,执行完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
Copy link
Owner

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

@quhw
Copy link

quhw commented Mar 25, 2017

我也是这个问题。

qq 20170325215027

@quhw
Copy link

quhw commented Mar 25, 2017

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

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

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

@walid1992
Copy link
Owner

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

@weiliang-Zhang
Copy link
Author

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

@walid1992
Copy link
Owner

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

@wzwgithubw
Copy link

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

@sunflowerlb
Copy link

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

@weiliang-Zhang
Copy link
Author

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

@fallowu
Copy link

fallowu commented Apr 10, 2017

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

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

@fallowu
Copy link

fallowu commented Apr 17, 2017

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

@xiaogaofudao
Copy link

这问题有谁解决了么

@SPACEX-2022
Copy link

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

@weiliang-Zhang
Copy link
Author

weiliang-Zhang commented Jun 5, 2017 via email

@shy19940217
Copy link

怎么一直报错

@shy19940217
Copy link

求解啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants