2

Currently, I am studying about ReactJS with Atom Editor and I want to try out ATOM REACT PLUGIN. For the installation, it require me to use the command apm install react but the Windows CMD doesn't recognize apm. After searching on the internet, it seems that calling the apm command is simple on Mac but not simple on Windows. Is there a step by step installation guide for apm in Windows?

Install Shell Commands on Mac: enter image description here

In Windows version, I cannot find it out: enter image description here

2 Answers 2

7

Add it to the system path environment variables.

- `Win + R: then type %localappdata%` 
  • Go to Atom > app-(atom version)> resources > app > apm > bin

    Copy the entire path and open the system path environment settings window. Append to the end and confirm. Restart console(command prompt or gitbash)

    This applies to every command line interface, in case you want to know where the executable is located use the where command.

    - where apm

    - where node

courtesy :- https://github.com/atom/apm/issues/381#issuecomment-126911491

1
  • 2
    Please provide attribution if you're taking your answer from elsewhere
    – Rob
    Dec 27, 2016 at 23:09
1

The problem is that the Atom installation did not successfully add the Atom bin folder to the path.

I run into this issue quite a bit, as Windows environment variables are of finite size. On my dev machine, where I typically have many things installed, each install wants to add itself to the path, resulting in a very long PATH variable, which ends up being truncated by the OS, causing lots of headaches. It can actually break things quite badly for you, if the truncation happens at an unfortunate location.

Here's my solution:

You need to edit and clean up both the User PATH env variable, as well as System one.

  • I usually would copy them into a text editor (on Win7: Right-click on Computer->Properties->Advanced system settings->Environment Variables->double-click PATH)
  • then I replace the ';' character with a linebreak char (depending on your editor, it could be something else) for easier editing.
  • Then I proceed to remove duplicates
  • Then I remove long paths with environment variables that I previously defined. For example, there are lots of occurrence of 'C:\Program Files (X86)'. That's 22 characters for every occurrence. You can define a system environment variable, say 'PgmX86', then replace every occurrence of the longer string with '%PgmX86%'. You will save 14 characters for each occurrence. Similarly, replace occurrences of 'C:\Users\AppData\Local' with %LocalAppData%, which is a predefined variable.
  • I then restore the ';' characters instead of line breaks, and then paste back into the env variable setting dialog.

Once you go thru this kind of cleanup, don't forget to add %LocalAppData%\atom\bin to your user path.

That should take care of Atom and apm!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.