Configure global nprmrc file location in Windows
Asked Answered
A

1

5

In Windows, I want to change the default global npmrc location, how can I do this?

Amplifier answered 18/5, 2020 at 10:9 Comment(8)
Did you read docs.npmjs.com/configuring-npm/npmrc.html#per-user-config-file?Subtitle
Yes, I want to define global file , not per user.Amplifier
But the path you describe is to the per-user file. The global file is next one down in the linked docs.Subtitle
Where the global file is located in Windows?Amplifier
Looks like it's in AppData/Roaming by default: https://mcmap.net/q/265830/-nodejs-npm-global-config-missing-on-windows/3001761Subtitle
So this is the problem I'm facing, AppData it's a folder inside C:\Users\<user>, I want the global .npmrc file to be elsewhereAmplifier
Does this answer your question? nodejs npm global config missing on windowsHop
Duplicate of https://stackoverflow.com/questions/15536872. Right? - Downvoting instead of flagging as duplicate is not very helpful, I think.Hop
A
7

I ran npm config set prefix C:\npm to change the prefix of the global npmrc location.

And then npm config get globalconfig to get the exact expected global location (which is C:\npm\etc\npmrc).

I navigated to this location and defined my global npmrc there (I had to create the etc folder myself.

Amplifier answered 19/5, 2020 at 8:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.