-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] npx fails with ENOENT: no such file or directory, lstat 'C:\Users\Stefnotch\AppData\Roaming\npm' #7089
Comments
try to create this folder manually |
@bondarenkod Update: This has been fixed in the latest version of npm. |
yes I fix it manually |
@Aimeryyds Can you also confirm having run into this very issue with the current version of npm? |
This Stack Overflow answer here seem to suggest that this happens when running the command with a different user account than the user who installed npm. Haven't verified this, but this info might be relevant. |
Just ran into the same issue. Fixed it by manually creating the folder. |
|
Nice! |
neither am I, I just try to find people smarter than me and hope they post on the internet 😅 The underlying issue that causes this seems to be:
hope that helped with your learning, I am still learning as well |
I just downloaded and installed a default node.js after googling nodejs download windows, then following the first link: https://nodejs.org/en/download and then downloading and installing what it proposed, in my case now it's: node-v20.12.2-x64.msi. I got the error when I was trying to create react app with
Not in my case. I installed node.js as described above and then immediately ran This seems like a bug that should be fixed on npm and/or on the |
we are seeing this issue fairly regularly |
Thanks this worked for me |
node.js and npm aren't the same thing. node.js is a runtime environment to allow js to run on a non-browser env. npm is node package manager, which helps you easily install and manage node modules needed to run things in that environment. npx is node package execution, almost identical to npm exec, and similar to npm run. so yes, its an npm issue. that's why the command is |
Maybe it would be better UX if npx can explain the situation a bit more and suggest the workarounds (either installing npm globally or creating the app data folder manually) in the error? |
Thanks for the help bro, it worked :) |
This issue was also reported at nodejs/node#53538 . There, it got more attention from the right people, as the npm team doesn't seem to be monitoring this issue tracker too closely. Now we finally have a PR that might fix this issue |
Fixed in #7640 |
worked for me too |
Really helpful. Thanks. |
where do you create this folder? |
smthg like that C:\Users\Stefnotch\AppData\Roaming\npm |
can this be pinned to the top of this thread, or somewhere that can be seen by all threads referencing this issue? And I guess w/ "Update to latest" or something. looks like there are still folks trickling in after the fix and doing the ad-hoc solutions. just in case late-night debugging leads a tired dev down unnecessary rabbit holes 😅 |
@hzhang20902 Good point, I updated the issue. |
try to reinstalling create-react-app using the following command then, try running the create-react-app |
Fixed in #7640 , update to a new version of npm!
This issue has been fixed. Please do
npm install -g npm
or install a new Node.jsOld Behavior
When running
npx create-react-app some-name
, thennpx
throws an error message.This has been fixed in #7640 , update to a new version of npm!
Side note: I originally encountered it after creating a Threlte app, which includes the
@threlte/gltf
tool. I rannpm run model-pipeline:run
in the Threlte app, which runs an npx command under the hood.This is also a pretty widespread issue, as evidenced by
I suppose it'd be worthwhile to inform these people once it's fixed. I'll happily do so.
Expected Behavior
I expected
npx create-react-app some-name
to work.If the folder is missing, then
npm
should automatically create it.Steps To Reproduce
npx create-react-app some-name
%appdata%
(C:\Users\USERNAME\AppData\Roaming)npm
folder.npx create-react-app some-name
againApparently the
npm
folder isn't being created by every installer or something. So we can manually reproduce the failure condition.Environment
The text was updated successfully, but these errors were encountered: