Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I run a blank Cordova app in browser: You may not have the required environment or OS to run this project

I'm following the Get Started tutorial on https://cordova.apache.org/#getstarted but I'm getting an error despite following the instructions clearly, this is what I did:

npm install -g cordova
cordova create myApp
cd myApp
cordova platform add browser
cordova run browser

but at the end of the last command, I get an error:

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

Does anyone have any idea why this is happening?

I'm using NodeJS v0.12.7 and Cordova 5.4.0

like image 473
sgarcia.dev Avatar asked Nov 20 '15 16:11

sgarcia.dev


2 Answers

Although the tutorial you linked says browser for some reason. I don't see it on their "supported platform list", try using a platform which you think you're going to develop for and see if you have the same issues.

Link to the platform list (odd that browser isn't listed): https://cordova.apache.org/docs/en/latest/guide/support/index.html

like image 106
Ravenous Avatar answered Nov 02 '22 04:11

Ravenous


I have had a similar issue on my Debian 8.3 (jessie) with an installed Chromium from the offical debian package-sources.

The detailled error message was:

Error: Error executing "google-chrome --user-data-dir=/tmp/temp_chrome_user_data_dir_for_cordova http://localhost:8000/index.html": /bin/sh: 1: google-chrome: not found

To fix the issue, I have downloaded the (Google-) Chrome-Browser directly from their website, and installed the .deb-package.

After that I did a

cordova platform rm browser
cordova platform add browser
cordova build browser
cordova run browser

and it finally worked.

Summary:

Chromium doesn't work - use chrome

like image 23
Michael B Avatar answered Nov 02 '22 03:11

Michael B