Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
398 views
in Technique[技术] by (71.8m points)

node.js - Cannot run ionic. receives "No command 'ionic' found"

I want to start using the ionic framework, but unfortunately I'm already failing on the first step.

I am running Ubuntu 13.04 and I have node v0.10.25 installed. I've installed ionic, at described in their docs:

sudo npm install -g cordova
sudo npm install -g ionic

The installation went well, no errors or warnings, but after the installation I type

ionic

and I get the error:

No command 'ionic' found, did you mean:
 Command 'ionice' from package 'util-linux' (main)
 Command 'sonic' from package 'sonic' (universe)
ionic: command not found

I'm pretty new to ubuntu so I might have something not configured correctly, but I can't find what.

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

for some of you, the two answer above might not work. here's a more general solution for situation where you see "XX" command not found

first check your npm root and npm root -g the result for the npm root -g should be something like "/usr/local". if it's not, then you found your problem.

change it by:

npm config set prefix /usr/local

then npm root -g should give you something like /usr/local/lib/node_modules . Then go ahead re-install everything with -g you will be good to go!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...