简体   繁体   中英

Installing Apache Cordova - cordova: command not found

I am desperately trying to install and invoke apache cordova on my computer, following the instructions here (doing it by command line): http://cordova.apache.org/docs/en/3.5.0//guide_cli_index.md.html#The%20Command-Line%20Interface

I do install nodejs (v0.10.15) and npm (1.2.18) successfully. However, when I enter:

   sudo npm install -g cordova

It installs partially successfull, throwing some Exceptions in the end.

>npm ERR! Error: invalid version: 3001.0001.0000-dev-harmony-fb
>npm ERR!     at validVersion (/usr/lib/nodejs/read-package-json/read-json.js:573:40)
>npm ERR!     at final (/usr/lib/nodejs/read-package-json/read-json.js:323:23)
>npm ERR!     at /usr/lib/nodejs/read-package-json/read-json.js:139:33
>npm ERR!     at cb (/usr/lib/nodejs/slide/lib/async-map.js:48:11)
>npm ERR!     at /usr/lib/nodejs/read-package-json/read-json.js:251:40
>npm ERR!     at fs.js:268:14
>npm ERR!     at /usr/lib/nodejs/graceful-fs/graceful-fs.js:103:5
>npm ERR!     at Object.oncomplete (fs.js:107:15)
>npm ERR! If you need help, you may report this log at:
>npm ERR!     <http://bugs.debian.org/npm>
>npm ERR! or use
>npm ERR!     reportbug --attach /npm-debug.log npm
>npm ERR! System Linux 3.11.0-26-generic
>npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "cordova"
>npm ERR! cwd /
>npm ERR! node -v v0.10.15
>npm ERR! npm -v 1.2.18
>npm ERR! 
>npm ERR! Additional logging details can be found in:
>npm ERR!     /npm-debug.log
>npm ERR! not ok code 0

it looks like npm has been installed to /usr/share/npm在此处输入图片说明

which I added to my PATH (/etc/environment), proven by

  echo $PATH

Still, I cannot invoke

cordova

as, it keeps saying:

cordova: command not found

Who can help me?

I had the same issue on linux mint 16 and solved the issue with this post:

install gulp browserify gives error always

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM