0

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.

1
  • Could you please put the whole error in a single place? Don't split the message into multiple pieces. It's unreadable that way. Commented Dec 10, 2024 at 16:03

1 Answer 1

0

I found the answer... Apparently, Windows Security disables permissions of some files from connecting to internet or other third party apps. Go to Windows Security > Protection History > Find your blocked file > Controlled folder access settings > Turn Off

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.