![我已经成功安装了 cordova,但是显示 cordova:未找到命令](https://linux22.com/image/1060044/%E6%88%91%E5%B7%B2%E7%BB%8F%E6%88%90%E5%8A%9F%E5%AE%89%E8%A3%85%E4%BA%86%20cordova%EF%BC%8C%E4%BD%86%E6%98%AF%E6%98%BE%E7%A4%BA%20cordova%EF%BC%9A%E6%9C%AA%E6%89%BE%E5%88%B0%E5%91%BD%E4%BB%A4.png)
harish@harish-Lenovo-G510:~$ sudo npm install -g cordova
[sudo] password for harish:
/usr/bin/env: node: No such file or directory
harish@harish-Lenovo-G510:~$ nodejs --version
v0.10.25
harish@harish-Lenovo-G510:~$ sudo ln -s /usr/bin/nodejs /usr/bin/node
harish@harish-Lenovo-G510:~$ npm --version
4.4.1
harish@harish-Lenovo-G510:~$ git --version
git version 2.1.4
harish@harish-Lenovo-G510:~$ sudo npm install -g cordova
npm WARN npm npm does not support Node.js v0.10.25
npm WARN npm You should probably upgrade to a newer version of node as
we
npm WARN npm can't make any promises that npm will work with this
version.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN deprecated [email protected]: Use uuid module instead
/home/harish/.npm-packages/bin/cordova -> /home/harish/.npm-
packages/lib/node_modules/cordova/bin/cordova
/home/harish/.npm-packages/lib
`-- [email protected]
`-- [email protected]
`-- [email protected]
`-- [email protected]
`-- [email protected]
harish@harish-Lenovo-G510:~$ cordova --version
cordova: command not found
harish@harish-Lenovo-G510:~$ node -v
v0.10.25
答案1
您需要安装最新版本的nodejs
:
sudo apt-get install nodejs=6.*
然后尝试安装cordova