3

I think I really screwed up npm. So I tried to get gulp to work and it wasn't so I tried changing the route but by mistake I guess the article I was looking at was for mac and I have windows. Anyways I tried to do a solution and it was still working slightly at the time, so I opened up npm config edit and a file came up to change the prefix but when I did it, I accidentally just copied and pasted instead of putting my actually computer username and now npm wont work at all or even load anything and I am trying to relocate the file but I cant use npm now and I cant find the file.

I was using this to help me out npm - EPERM: operation not permitted on Windows

Kalana Demel
  • 2,821
  • 3
  • 19
  • 31
Joe Escobedo
  • 235
  • 1
  • 3
  • 14

2 Answers2

4

Found the answer.

You want to go to thisPC -> C: -> users -> \your computers username\ -> npmrc (NPM RC file), go into that file, go to prefix= (kind of at the top) and then fix the path. Thanks everyone!

Joe Escobedo
  • 235
  • 1
  • 3
  • 14
1

Just uninstall and reinstall node entirely. It will be faster than attempting to fix this problem.

Christopher Reid
  • 3,364
  • 2
  • 25
  • 63
  • Tried that. still didnt fix the problem – Joe Escobedo Oct 21 '17 at 03:51
  • How did you 'uninstall' it? Otherwise you need to give more details on what you did to break it. Actual commands would be helpful. If actually uninstalling it (removing EVERYTHING node related) doesn't help then you probably modified your windows path and should go delete anything node related from there as well. The only reason a clean reinstall wouldn't work is if you didn't actually remove everything from before. – Christopher Reid Oct 21 '17 at 03:53
  • Run npm config edit (You will get notepad editor) Change Prefix variable to C:\Users\\AppData\Roaming\npm – Joe Escobedo Oct 21 '17 at 03:54
  • these are what I used and once i changed the Prefix variable, it broke – Joe Escobedo Oct 21 '17 at 03:54
  • find the npm config file manually and change it to what it should be... – Christopher Reid Oct 21 '17 at 03:55
  • I've been looking and I cant find it. ive gone though the node files and folders, npm's files and folders and I still cant find them. I'll keep looking and see if I can find anything – Joe Escobedo Oct 21 '17 at 03:56
  • there might be multiple files. It is called "npmrc" on unix-based systems, probably the same on windows. Unfourtunately it's probably somewhere the basic windows file search doesn't look... there must be a way around that though. – Christopher Reid Oct 21 '17 at 04:01
  • it might be here %ProgramFiles%\nodejs\node_modules\npm\npmrc or in %AppData%... but should be found wherever npm runs from... SOMETHING\nodejs\node_modules\npm\npmrc – Christopher Reid Oct 21 '17 at 04:02
  • prefix=${APPDATA}\npm this is what I get, but when I changed the PATH, it had more text in it. – Joe Escobedo Oct 21 '17 at 04:05
  • Have you searched through %AppData% ? – Christopher Reid Oct 21 '17 at 04:09
  • looking for that at the moment and cant find it. would that be in the npm folder? – Joe Escobedo Oct 21 '17 at 04:10