Cordova浏览器错误

Cordova浏览器错误,cordova,Cordova,我想测试cordova并构建一个简单的测试应用程序。 我从楼梯上走下来 以下是一些输出(以前的输出没有错误): 我最终打开了一个chrome浏览器,出现了一个错误:ERR\u CONNECTION\u RESET 我跳过什么了吗? 如何使用cordova的浏览器平台 谢谢, JNQ 编辑:下面是带有详细选项的add命令: No scripts found for hook "before_platform_add". No version supplied. Retrieving version

我想测试cordova并构建一个简单的测试应用程序。 我从楼梯上走下来

以下是一些输出(以前的输出没有错误):

我最终打开了一个chrome浏览器,出现了一个错误:ERR\u CONNECTION\u RESET

我跳过什么了吗? 如何使用cordova的浏览器平台

谢谢, JNQ

编辑:下面是带有详细选项的add命令:

No scripts found for hook "before_platform_add".
No version supplied. Retrieving version from config.xml...
Adding browser project...
Failed to require PlatformApi instance for platform "browser". Using polyfill instead.
Running command: cmd "/s /c "C:\Users\jnq\.cordova\lib\npm_cache\cordova-browser\4.1.0\package\bin\create.bat C:\Users\jnq\Desktop\testCordova\TestLights\platforms\browser io.cordova.hellocordova HelloCordova""
Creating Browser project. Path: platforms\browser
Command finished with error code 0: cmd /s /c "C:\Users\jnq\.cordova\lib\npm_cache\cordova-browser\4.1.0\package\bin\create.bat C:\Users\jnq\Desktop\testCordova\TestLights\platforms\browser io.cordova.hellocordova HelloCordova"
Error loading cordova-browser
Checking for any plugins added to the project that have not been installed in browser platform
No differences found between plugins added to project and installed in browser platform. Continuing...
Generating config.xml from defaults for platform "browser"
Installing plugin "cordova-plugin-whitelist" following successful platform add of browser
Found variables for "cordova-plugin-whitelist". Processing as cli_variables.
Installing "cordova-plugin-whitelist" for browser
Running command: cmd "/s /c "C:\Users\jnq\Desktop\testCordova\TestLights\platforms\browser\cordova\version.bat""
Command finished with error code 0: cmd /s /c "C:\Users\jnq\Desktop\testCordova\TestLights\platforms\browser\cordova\version.bat"
Finding scripts for "before_plugin_install" hook from plugin cordova-plugin-whitelist on browser platform only.
No scripts found for hook "before_plugin_install".
Install start for "cordova-plugin-whitelist" on browser.
Beginning processing of action stack for browser project...
Action stack processing complete.
Install complete for cordova-plugin-whitelist on browser.
Finding scripts for "after_plugin_install" hook from plugin cordova-plugin-whitelist on browser platform only.
No scripts found for hook "after_plugin_install".
No scripts found for hook "before_prepare".
Checking config.xml for saved platforms that haven't been added to the project
Checking for any plugins added to the project that have not been installed in browser platform
No differences found between plugins added to project and installed in browser platform. Continuing...
Generating config.xml from defaults for platform "browser"
No scripts found for hook "after_prepare".
Checking config.xml for saved plugins that haven't been added to the project
Saving browser@4.1.0 into platforms.json
No scripts found for hook "after_platform_add".
和run命令的一个:

C:\Users\jnq\Desktop\testCordova\TestLights>cordova run browser --verbose
No scripts found for hook "before_run".
No scripts found for hook "before_prepare".
Checking config.xml for saved platforms that haven't been added to the project
Error loading cordova-browser
Checking for any plugins added to the project that have not been installed in browser platform
No differences found between plugins added to project and installed in browser platform. Continuing...
Generating config.xml from defaults for platform "browser"
No scripts found for hook "after_prepare".
Checking config.xml for saved plugins that haven't been added to the project
Running command: cmd "/s /c "C:\Users\jnq\Desktop\testCordova\TestLights\platforms\browser\cordova\build.bat""
Cleaning Browser project
Command finished with error code 0: cmd /s /c "C:\Users\jnq\Desktop\testCordova\TestLights\platforms\browser\cordova\build.bat"
No scripts found for hook "before_deploy".
Running command: cmd "/s /c "C:\Users\jnq\Desktop\testCordova\TestLights\platforms\browser\cordova\run.bat --nobuild""
Static file server running @ http://localhost:8000/index.html
CTRL + C to shut down

Edit2:显然,我可以使用另一个端口运行它,然后使用8000。

如果您在使用cordova浏览器平台时遇到连接错误,请尝试使用另一个端口:
cordova运行浏览器--port=8080

尝试使用
cordova平台添加浏览器--verbose
查看添加过程中的一些错误消息。我真的看不出输出有任何问题:(所以都是关于阻塞端口?很好,祝你学习cordova:)也尝试一下Ionic。Ionic看起来也很有趣,感谢您的帮助:)如果您有Visual Studio,您可以使用。我发现这比命令行更容易。
C:\Users\jnq\Desktop\testCordova\TestLights>cordova run browser --verbose
No scripts found for hook "before_run".
No scripts found for hook "before_prepare".
Checking config.xml for saved platforms that haven't been added to the project
Error loading cordova-browser
Checking for any plugins added to the project that have not been installed in browser platform
No differences found between plugins added to project and installed in browser platform. Continuing...
Generating config.xml from defaults for platform "browser"
No scripts found for hook "after_prepare".
Checking config.xml for saved plugins that haven't been added to the project
Running command: cmd "/s /c "C:\Users\jnq\Desktop\testCordova\TestLights\platforms\browser\cordova\build.bat""
Cleaning Browser project
Command finished with error code 0: cmd /s /c "C:\Users\jnq\Desktop\testCordova\TestLights\platforms\browser\cordova\build.bat"
No scripts found for hook "before_deploy".
Running command: cmd "/s /c "C:\Users\jnq\Desktop\testCordova\TestLights\platforms\browser\cordova\run.bat --nobuild""
Static file server running @ http://localhost:8000/index.html
CTRL + C to shut down