我已经成功安装了 cordova,但是显示 cordova:未找到命令

我已经成功安装了 cordova,但是显示 cordova:未找到命令
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

相关内容