I'm getting an ENOENT error when running create-next-app (or similar)

I've been told it might be because I've a space in my username, which is nuts imo, given it seems overly complicated to change (windows 11). I've been coding for about a month on this laptop with no issues (granted, using Astro and React). But I checked a similar tool - create-react-app - and suffered the same thing. Anyone know what the problem is for sure/any advice?
npm ERR! path C:\Users\Nick Woodward\AppData\Roaming\npm npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\Nick Woodward\AppData\Roaming\npm'
6 Replies
lko
lko3mo ago
Do you have the folder?
Nick
Nick3mo ago
hi @lko, do you mean the npm folder? i'll check, but i've been using npm fine in my astro projects
lko
lko3mo ago
Yeah check if there's the folder in AppData/Roaming/npm
Nick
Nick3mo ago
now i feel stupid, no, there isn't although i'm not sure that was on me, outside of checking 😄 in AppData I have local, locallow, roaming, and none have an npm folder local has an npm-cache
lko
lko3mo ago
I dont know how to fix it then, because I guess that when you installed NPM you've installed it somewhere else, so maybe reinstalling npm in that location will work
Nick
Nick3mo ago
that's ok, that's still waaaaaay better than having to change my username because the path is playing up, so you've given me a lifeline! thanks!