Cannot run ionic. receives “No command 'ionic' found”

前端 未结 13 1306
灰色年华
灰色年华 2020-12-14 08:11

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\

相关标签:
13条回答
  • 2020-12-14 08:40

    I had the same problem.

    I solved the problem by cd to my root. Then install ionic as root admin.

    $ sudo npm install -g cordova ionic
    

    then run

    $ ionic
    

    to see if its working.

    Hope that helps

    0 讨论(0)
  • 2020-12-14 08:40

    you can change temporary : npm config set prefix C:\Users[username]\AppData\Roaming\npm\node_modules2

    • change the Path in Environment Variables set C:\Users[username]\AppData\Roaming\npm\node_modules2

    • Run your command to install your package .

    • open file explorer copy the link C:\Users[username]\AppData\Roaming\npm\node_modules

      ok file yourpackage.CMD created another folder Created "node_modules2" in node_modules and contain your package folder.

    • copy your package file CMD to parent folder "npm"

    • copy your package folder to parent folder "node_modules"

    • now run npm config set prefix C:\Users[username]\AppData\Roaming\npm

    • change the Path in Environment Variables set C:\Users[username]\AppData\Roaming\npm

    • now package working correctly with Command line

    => this method working with me When npm block in installation Package for IONIC installation and ReactNative and another package npm.

    0 讨论(0)
  • 2020-12-14 08:41

    Run npm root -g, copy the result path and add it to the paths file:

    sudo nano /etc/paths

    Restart your console and it will work.

    0 讨论(0)
  • 2020-12-14 08:43

    In my case, I have just uninstalled ionic and then reinstalled it. And it is working fine now.

    0 讨论(0)
  • 2020-12-14 08:49

    Well I found it finally.

    The ionic installation was at /home/guy/npm/bin/ionic, not at /usr/bin/ionic at it should be.

    Solved it with:

    sudo ln -s /home/guy/npm/bin/ionic /usr/bin/ionic
    

    Thanks!

    0 讨论(0)
  • 2020-12-14 08:50

    I had the same problem with “bash: ionic: command not found”, then I added:

    %USERPROFILE%\AppData\Roaming\npm

    to my environment variable’s path, then I reinstalled ionic and cordova and it start working.

    0 讨论(0)
提交回复
热议问题