我想在Ionic View中查看我的离子项目,但它显示的只是一个白屏。尝试运行离子运行android -l -c来调试我的项目,但它向我显示以下响应
ionic-hello-world@0.0.0 ionic:serve C:\Users\GClairGC\Desktop\Angular\wasteman agementsystem ionic-app-scripts serve "--v2" "--runLivereload" "--isPlatformServe" "--consol elogs" "--livereload" "--port" "8101" "--livereload-port" "35730" "--地址" "1 92.168.8.228" "--iscordovaserve" "--nobrowser">
[21:47:32] 离子应用脚本 1.3.0 [21:47:32] 手表已启动... [21:47:32] 生成开发已开始...事件.js:160 投掷者;未处理的"错误"事件 ^
错误:侦听 EADDRINUSE 0.0.0.0:53703 在Object.exports._errnoException (util.js:1018:11) 在exports._exceptionWithHostPort (util.js:1041:20) 在Server._listen2 (净.js:1262:14) 收听时(净.js:1298:10) 净.js:1408:9 在_combinedTickCallback(内部/进程/next_tick.js:83:11) 在process._tickCallback(内部/进程/next_tick.js:104:9) at Module.runMain (module.js:606:11) 运行时 (bootstrap_node.js:393:7) 启动时 (bootstrap_node.js:150:9)
呵呵!Windows_NT 6.3.9600 npm 错误!argv "C:\Program Filesodejsode.exe" "C:\Program Filesodejs\ node_modulespm\binpm-cli.js" "运行" "ionic:serve" "--" "--v2" "--runLivere load" "--isPlatformServe" "--consolelogs" "--livereload" "--端口" "8101" "--实时重新加载端口" "35730" "--地址" "192.168.8.228" "--iscordovaserve" "--nobrowser " npm 错误!节点 v6.10.2 npm 错误!npm v3.10.10 npm 错误!代码 电子生命周期 npm 错误! ionic-hello-world@0.0.0 ionic:serve:
ionic-app-scripts serve "--v2" "- -runLivereload" "--isPlatformServe" "--consolelogs" "--livereload" "--port" "810 1" "--livereload-port" "35730" "--address" "192.168.8.228" "--iscordovaserve" "- -nobrowser"
npm 错误!退出状态 1 npm 错误!呵呵!在ionic-hello-world@0.0.0 ionic:serve脚本'ionic-app-scr ipts serve "--v2" "--runLivereload" "--isPlatformServe" "--consolelogs" "--liver eload" "--port" "8101" "--livereload-port" "35730" "--地址" "192.168.8.228" " --iscordovaserve" "--nobrowser"'.呵呵!确保已安装最新版本的 node.js 和 npm。呵呵!如果你这样做,这个 很可能是离子-你好-世界PAC Kage的问题,npm ERR! 不是 npm 本身。呵呵!告诉作者,这在你的 系统:错误! ionic-app-scripts serve "--v2" "--runLivereload" "--isPlatformServe " "--consolelogs" "--livereload" "--port" "8101" "--实时加载端口" "35730" "-- 地址" "192.168.8.228" "--iscordovaserve" "--nobrowser" npm 错误!您可以获得以下信息: 如何使用以下方法为该项目打开问题:npm ERR! npm 错误 离子-你好-世界 npm 错误!或者,如果不可用,您可以获得 他们的信息通过以下方式: npm 错误! npm 所有者 ls ionic-hello-world npm 错误! 上面可能有其他日志记录输出。呵呵!请在任何支持请求中包含以下文件: 呵呵!
C:\Users\GClairGC\Desktop\Angular\wastemanagementsystempm-debug.log
包.json
{ "name": "ionic-hello-world", "version": "0.0.0", "author": "Ionic Framework", "homepage": "http://ionicframework.com/", "private": true, "scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve" },
"dependencies": {
"@angular/common": "4.0.0",
"@angular/compiler": "4.0.0",
"@angular/compiler-cli": "4.0.0",
"@angular/core": "4.0.0",
"@angular/forms": "4.0.0",
"@angular/http": "4.0.0",
"@angular/platform-browser": "4.0.0",
"@angular/platform-browser-dynamic": "4.0.0",
"@angular/router": "4.0.0",
"@ionic-native/core": "3.4.2",
"@ionic-native/splash-screen": "3.4.2",
"@ionic-native/status-bar": "3.4.2",
"@ionic/storage": "2.0.1",
"angular2-qrcode": "^2.0.1",
"firebase": "^3.8.0",
"ionic-angular": "3.0.1",
"ionicons": "3.0.0",
"rxjs": "5.1.1",
"sw-toolbox": "3.4.0",
"zone.js": "^0.8.4" },
"devDependencies": {
"@ionic/app-scripts": "1.3.0",
"typescript": "~2.2.1" },
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard" ],
"cordovaPlatforms": [],
"description": "auth: An Ionic project" }
索引.html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<!--<title>Loading..</title>-->
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#4e8ef7">
<!-- cordova.js required for cordova apps -->
<script src="cordova.js"></script>
<!-- un-comment this code to enable service worker
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(() => console.log('service worker installed'))
.catch(err => console.log('Error', err));
}
</script>-->
<link href="build/main.css" rel="stylesheet">
</head>
<body>
<!-- Ionic's root component and where the app will load -->
<ion-app></ion-app>
<!-- The polyfills js is generated during the build process -->
<script src="build/polyfills.js"></script>
<!-- The bundle js is generated during the build process -->
<script src="build/main.js"></script>
</body>
</html>
嗨,首先尝试运行ionic serve
在此之后尝试运行ionic build android
而不是尝试ionic run -l -c
它会为你工作。
如果你在一段时间之前就开始了你的poject,让我告诉你很多事情都发生了变化,在你的index.html
中应该有这些行,还有一些其他的事情被改变:
<!-- Polyfill needed for platforms without Promise and Collection support -->
<script src="build/js/es6-shim.min.js"></script>
<!-- Zone.js and Reflect-metadata -->
<script src="build/js/angular2-polyfills.js"></script>