This error is halting my progress since last week... I've tried AI, Google search, Github, asking experienced people, nothing works. So I'm just a starter in react and nodejs. I was following Dr. Angela Yu's Udemy course for Web dev and now I'm at a standstill. When I downloaded and installed nodejs everything was normal. I chose everything default except I chose npm package manager in custom installation.It seems npm is unable to write and is also unable to create a package.json file. Node version: 22.11.0 and Windows 11 Home.
This is what I got when trying to create a *react app: npx create-react-app*
node:fs:2344
return binding.writeFileUtf8(
Error: ENOENT: no such file or directory, open 'file path...\package.json' at Object.writeFileSync (node:fs:2344:20)at createApp (C:\Users\divyo\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:271:6) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {errno: -4058,code: 'ENOENT',syscall: 'open',path: 'C:\Users...\package.json'}
Even a simple *npm init* is not working.
npm error code ENOENTnpm error syscall opennpm error path C:\Users...\package.jsonnpm error errno -4058npm error enoent ENOENT: no such file or directory, open 'C:\Users...\package.json'npm error enoent This is related to npm not being able to find a file.npm error enoent
How can it find package.json if it does not even create it. I once tried even manipulating npm permissions to allow write but wasn't allowed to do that. I tried repairing through nodejs installer setup but to no avail.