2

I am trying to install npm so I can install less. I just went to the node.js website and installed node. however, when i type npm in the command prompt i get the error:

Error: Failed to replace env in config: ${APPDATA} at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:429:13 etc.

Any suggestions?

I think node installed because node -v yeilds v0.12.7

10
  • I think your path might not be set up right. Try over here: stackoverflow.com/questions/27864040/… Commented Aug 18, 2015 at 20:10
  • 1
    thanks @ZacharyDow for the hints. i followed that and then used this link that i had seen before github.com/npm/npm/issues/7468 Commented Aug 18, 2015 at 20:39
  • No problem, so it's working for you with that fix? Commented Aug 18, 2015 at 20:40
  • @ZacharyDow I think so, it seems to work. when I typed npm install -g less some text appears. however it is not recognizing lessc as a command. is there a way to check? Commented Aug 18, 2015 at 20:49
  • when i just type npmmy cmd shows Usabe: npm <command> so that looks good i think Commented Aug 18, 2015 at 20:50

1 Answer 1

2

You need to configure your 'AppData' environment variable.

https://github.com/npm/npm/issues/7468

I just created a environment variable called APPDATA with the value like this:

variable : APPDATA

value :C:\Users\my_user_name\AppData\Roaming\npm;npm

Sign up to request clarification or add additional context in comments.

1 Comment

As of Nov 2016, it appears the npmrc file appends the npm folder. The above value caused all kinds of folder problems. Setting APPDATA to just c:\users\<username>\AppData\Roaming worked. And APPDATA should be a User (not system) environment variable

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.