我想在离子视图中查看我的离子项目,但所有显示的都是白色屏幕。尝试运行离子运行android -l -c来调试我的项目,但它向我显示以下响应
ionic-hello-world@0.0.0 ionic:提供C:\ Users \ GClairGC \ Desktop \ Angular \ wasteman agementsystem ionic-app-scripts服务" - v2" " - runLivereload" " - isPlatformServe" " - consol elogs" " - livereload" " - 端口" " 8101" " - livereload端口" " 35730" " - 地址" " 1 92.168.8.228" " - iscordovaserve" " - nobrowser"
[21:47:32] ionic-app-scripts 1.3.0 [21:47:32]观看开始...... [21:47:32] build dev开始...... events.js:160 扔掉//未处理的错误'事件 ^
错误:听EADDRINUSE 0.0.0.0:53703 at Object.exports._errnoException(util.js:1018:11) at exports._exceptionWithHostPort(util.js:1041:20) 在Server._listen2(net.js:1262:14) 在听(net.js:1298:10) 在net.js:1408:9 at _combinedTickCallback(internal / process / next_tick.js:83:11) at process._tickCallback(internal / process / next_tick.js:104:9) 在Module.runMain(module.js:606:11) 在运行时(bootstrap_node.js:393:7) 在启动时(bootstrap_node.js:150:9)
npm ERR! Windows_NT 6.3.9600 npm ERR! argv" C:\ Program 文件\的NodeJS \ node.exe" " C:\ Program Files \ nodejs \ node_modules \ NPM \ BIN \ NPM-cli.js" "运行" "离子型:服务" " - " " - V2" " - runLivere load" " - isPlatformServe" " - consolelogs" " - livereload" " - 端口" " 8101" " - live reload-port" " 35730" " - 地址" " 192.168.8.228" " - iscordovaserve" " - nobrowser"错误的ERR!节点 v6.10.2 npm ERR! npm v3.10.10 npm ERR!代码ELIFECYCLE npm ERR! ionic-hello-world@0.0.0离子:发球:
ionic-app-scripts serve "--v2" "- -runLivereload" "--isPlatformServe" "--consolelogs" "--livereload" "--port" "810 1" "--livereload-port" "35730" "--address" "192.168.8.228" "--iscordovaserve" "- -nobrowser"
npm ERR!退出状态1 npm ERR!错误的ERR!在ionic-hello-world@0.0.0离子失败:服务脚本&ion-app-scr ipts服务 " - V2" " - runLivereload" " - isPlatformServe" " - consolelogs" " - 肝 电子负载" " - 端口" " 8101" " - livereload端口" " 35730" " - 地址" " 192.168.8.228" " --iscordovaserve" " - nobrowser"&#39 ;.错误的ERR!确保安装了最新版本的node.js和npm。错误的ERR!如果你这样做,这个 很可能是离子问题世界的问题,npm ERR! 不是与npm本身。错误的ERR!告诉作者你的失败了 系统:npm ERR! ionic-app-scripts服务" - v2" " - runLivereload" " - isPlatformServe" " - consolelogs" " - livereload" " - 端口" " 8101" " - livereload端口" " 35730" " - 地址" " 192.168.8.228" " - iscordovaserve" " - nobrowser"错误的ERR!您可以获得有关的信息 如何使用以下命令打开此项目的问题:npm ERR! npm错误 离子 - 你好世界npm ERR!或者,如果没有,你可以得到 他们的信息来自:npm ERR! npm owner ls ionic-hello-world npm ERR! 上面可能有额外的日志记录输出。npm ERR!请在任何支持请求中包含以下文件: npm ERR!
C:\用户\ GClairGC \桌面\角\ wastemanagementsystem \ NPM-的debug.log
的package.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" }
的index.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>
答案 0 :(得分:0)
首先尝试在尝试运行ionic serve
之后运行ionic build android
而不是尝试
ionic run -l -c
它适合你。
答案 1 :(得分:0)
如果你在一段时间之前开始了你的项目,那么让我告诉你许多事情已经改变了,你的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>