简体   繁体   中英

Unable to install Cordova CLI

When I'm trying to install the Cordova CLI with "sudo npm install -g cordova", everything seems to work fine:

/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
cordova@6.1.1 /usr/local/lib/node_modules/cordova
├── underscore@1.7.0
├── q@1.0.1
├── ansi@0.3.1
├── nopt@3.0.1 (abbrev@1.0.7)
├── update-notifier@0.5.0 (is-npm@1.0.0, string-length@1.0.1, repeating@1.1.3, semver-diff@2.1.0, chalk@1.1.3, configstore@1.4.0, latest-version@1.0.1)
├── cordova-common@1.2.0 (cordova-registry-mapper@1.1.15, unorm@1.4.1, underscore@1.8.3, q@1.4.1, semver@5.1.0, osenv@0.1.3, bplist-parser@0.1.1, shelljs@0.5.3, glob@5.0.15, elementtree@0.1.6, plist@1.2.0)
└── cordova-lib@6.1.1 (valid-identifier@0.0.1, opener@1.4.1, properties-parser@0.2.3, semver@4.3.6, nopt@3.0.6, dep-graph@1.1.0, shelljs@0.3.0, xcode@0.8.0, request@2.47.0, cordova-serve@1.0.0, aliasify@1.9.0, init-package-json@1.9.3, cordova-app-hello-world@3.10.0, tar@1.0.2, cordova-js@4.1.4, npm@2.15.5)

But my system information stays the same:

Cordova CLI: Not installed
Ionic Framework Version: 2.0.0-beta.6
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
ios-deploy version: 1.8.6 
ios-sim version: 5.0.8 
OS: Mac OS X El Capitan
Node Version: v4.4.4
Xcode version: Xcode 7.3.1 Build version 7D1014 

I also tried to install a specific package of the Cordova CLI with "npm install -g cordova@6.1.1" and to unistall and reinstall Cordova, but I still get:

Cordova CLI: Not installed

I suggest you to have a look at this link .It's mostly a permission issue and sudo should do the trick. Try executing the following command,

sudo ionic info

Hope it helps.

使用nvm 8.1.3,然后使用sudo npm install -g cordova命令安装Cordova对我有用。

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