[英]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.