1

I have tried to install ionic on Windows but installation has failed. What should I do? I have tried more than 20 times but still I got the same problem. Here I have attached the screenshot for this

Entered commands:

 npm install -g cordova
 npm install -g ionic

Note: this one windows server machine

enter image description here

mentallurg
  • 4,967
  • 5
  • 28
  • 36
Akbar Basha
  • 1,168
  • 1
  • 16
  • 38
  • did you try restarting cmd (obvious question..sry). Also does `cordova -v` work? – Suraj Rao Dec 30 '17 at 05:07
  • @SurajRao same error thrown for trying cordova – Akbar Basha Jan 01 '18 at 12:23
  • check https://stackoverflow.com/questions/9587665/nodejs-cannot-find-installed-module-on-windows – Suraj Rao Jan 01 '18 at 12:26
  • check if your global npm_modules path is in environment path variables – Suraj Rao Jan 01 '18 at 13:00
  • I see you've taken the time to block out your username (for security reasons). I have started using the account user1 so that my personal information is not included in examples I want to share. I will sometimes reproduce problems for StackOverflow using the directory c:\temp\some-project for the same reason. – PatS Apr 04 '18 at 22:33

1 Answers1

0

My guess is that the NPM global path has not been added to your windows path. These are the steps to try:

  • First verify that the command just installed can run. The output contains the full path to the command installed, just copy and paste it to the command line. In your case it might be something like this %APPDATA%\Roaming\npm\iconic -v

Lets assume that works. That means that the command was successfully installed and will run, now we need to add it to your PATH so you can run it from the command line.

  • Next, Press Windows key and type "path" and select "Edit environment variables for your account". From here. Add or append the path %APPDATA%\Roaming\npm to your PATH variable, and save the results.

Once it is on your PATH you can run it from any command shell window.

  • Next, start a new command shell (e.g., Windows+R, cmd, Enter) and then type the command iconic -v. Viola, it should work without requiring the full path to the script.

I'm doing most of this from memory so hopefully it's correct. But if it needs some tweeks, let me know and I'll update the answer.

For completness, this install didn't actually fail. The lines with fsevents are warnings. The fsevents package is only designed to work on Mac Unix so these warnings can be safely ignored.

As Suraj Rao mentioned, also see Nodejs cannot find installed module on Windows?.

PatS
  • 8,833
  • 12
  • 57
  • 100