简体   繁体   中英

Unable to install ionic on MacBook Pro using npm install -g cordova ionic?

I am logged in as admin user. I have installed latest node.js from https://nodejs.org/en/ using node-v6.9.1.pkg file. I have installed it for all users.

When I try to execute following command as given on ionic side ( https://ionicframework.com/getting-started/ ):

npm install -g cordova ionic

Also I tried above command using sudo but I am getting error like :

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module 'github-url-from-git'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/myusername/npm-debug.log

I am new to Mac, what might be the cause ?

Seems that is a nodejs problem. Follow these steps:

1) rm -rf /usr/local/lib/node_modules/npm

2) reinstall nodejs

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