我正在按照
https://cordova.apache.org/#getstarted的“入门”教程进行操作,但是尽管按照说明进行了清楚,我仍然收到错误,这就是我所做的:
npm install -g cordova cordova create myApp cd myApp cordova platform add browser cordova run browser
但在最后一个命令结束时,我收到一个错误:
C:\code\cordova\test λ cordova run browser Running command: cmd "/s /c "C:\code\cordova\test\platforms\browser\cordova\run.bat"" C:\code\cordova\test\platforms\browser\cordova\node_modules\cordova-serve\node_modules\q\q.js:155 throw e; ^ Error: listen EACCES at exports._errnoException (util.js:746:11) at Server._listen2 (net.js:1139:19) at listen (net.js:1182:10) at Server.listen (net.js:1267:5) at module.exports (C:\code\cordova\test\platforms\browser\cordova\node_modules\cordova-serve\src\server.js:134:8) at C:\code\cordova\test\platforms\browser\cordova\node_modules\cordova-serve\src\platform.js:45:16 at _fulfilled (C:\code\cordova\test\platforms\browser\cordova\node_modules\cordova-serve\node_modules\q\q.js:834:54) at self.promiseDispatch.done (C:\code\cordova\test\platforms\browser\cordova\node_modules\cordova-serve\node_modules\q\q.js:863:30) at Promise.promise.promiseDispatch (C:\code\cordova\test\platforms\browser\cordova\node_modules\cordova-serve\node_modules\q\q.js:796:13) at C:\code\cordova\test\platforms\browser\cordova\node_modules\cordova-serve\node_modules\q\q.js:857:14 ERROR running one or more of the platforms: Error: cmd: Command Failed with exit code 1 You may not have the required environment or OS to run this project
有谁知道为什么会这样?
我正在使用NodeJS v0.12.7和Cordova 5.4.0
解决方法
虽然您链接的教程出于某种原因说浏览器.我没有在他们的“支持的平台列表”中看到它,尝试使用您认为您将要开发的平台,并查看您是否遇到相同的问题.
链接到平台列表(奇怪该浏览器未列出):https://cordova.apache.org/docs/en/latest/guide/support/index.html