4

I have installed 3 new packages recently through NPM and none of them are executing.

I ran sudo npm install -g ionic and the installation looked like normal.

Then I can run which ionic and I get /usr/local/bin/ionic which looks good.

But if I run ionic start myApp tabs according to the documentation this should create a new ionic project. But instead it does absolutely nothing. No output on the command line, no project created. I press enter to execute the command and it immediately returns to another line on the command line as if I simply pressed enter with no command entered at all... This may not be clear, sorry.

I tried uninstalling ionic with sudo npm uninstall -g ionic which uninstalled it successfully, and then re-installed it. No change in behavior. Same is happening for the packages cordova and bower. Note: all of these I installed at the same time, and all of them are not working. No output, no errors, no nothing. Running them with sudo doesn't make a difference either.

I am running ubuntu 14.04.

Has anyone experienced this before?

SnareChops
  • 143
  • 1
  • 5

3 Answers3

13
  1. Run

    which node
    

    and in my case it displayed /usr/sbin/node.

  2. If it says command not found, skip to 3. Remove it by

    sudo rm /usr/sbin/node
    
  3. Run

    which nodejs
    

    in my case it displayed /usr/bin/nodejs.

  4. Make a link

    sudo ln -s /usr/bin/nodejs /usr/bin/node 
    

    OR

    sudo ln -s /usr/bin/nodejs /usr/sbin/node 
    
Eric Carvalho
  • 54,385
Basit
  • 636
  • 5
  • 7
0

it also can be because of outdated nodejs installed according to https://stackoverflow.com/questions/21362636/phonegap-cli-on-linux-doesnt-do-anything it can be fixed in next way:

sudo apt-get install curl
npm update npm -g
sudo npm install n -g
sudo n stable

and then npm remove -g ionic && npm install -g ionic

skyboy
  • 1
-1

I think installing any application other than apt-get may have the same problem.Try to use

which ionic start MyApps tab 

Or
which ionic
Then
-command for importing templates here- start MyApps tab 
Rohan
  • 78
  • 7