[英]Cannot serve ionic3 app in localhost with ionic serve (blank page)
嗨,大家好,我在一个应用程序上工作了2个月,以前从未有过。 今天,我打了离子发球,这让我空白了。 我再次尝试了一次; 没有改变。
控制台的错误是这样的:
```
Failed to load resource: the server responded with a status of 404 (Not Found)
vendor.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.js Failed to load resource: the server responded with a status of 404 (Not Found)
vendor.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.css Failed to load resource: the server responded with a status of 404 (Not Found)
```
然后我在互联网上搜索解决方案并尝试了以下操作:
```
npm uninstall -g cordova ionic
npm install -g cordova ionic
```
但是没有用!
所以我记得,曾经备份过我的应用文件夹。 所以我尝试了一下,看到了它的效果。 我将备份文件夹的www / build文件夹文件复制到了我最新的应用程序文件夹中。 并再次运行离子服务。 它会自动删除所有文件,不起作用吗?
我无法提供我的应用程序? 请帮助我。 我什么也没收到,我很震惊!
终奌站:
```
Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser -
Ctrl+C to cancel
[04:35:39] watch started ...
[04:35:39] build dev started ...
[04:35:39] clean started ...
[04:35:39] clean finished in 7 ms
[04:35:39] copy started ...
[04:35:39] deeplinks started ...
[04:35:39] deeplinks finished in 236 ms
[04:35:39] transpile started ...
[04:35:43] dev server running: http://localhost:8100/
[OK] Development server running!
Local: http://localhost:8100
External: http://192.168.1.3:8100, http://192.168.136.1:8100, http://192.168.80.1:8100
DevApp: DenemeApp@8100 on ASUS
[04:35:44] copy finished in 4.77 s
[04:35:44] watch ready in 4.94 s
```
在这里停止。
我的离子信息:
```
cli packages: (C:\Users\Uğur\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.0.1
Cordova Platforms : none
Ionic Framework : ionic-angular 3.8.0
System:
Node : v6.11.4
npm : 3.10.10
OS : Windows 8.1
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
```
尝试在端口8102中提供应用程序。我不知道您如何管理它。 但是您更改了可用于构建的端口。 因此,运行以下命令:
$ ionic serve --p 8102
我找不到解决方案,幸运的是我最近备份了该项目。 我不知道我对主文件夹做了什么,但是我的备份文件夹运行良好。 我做了完全相同的更改(更新)及其工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.