close

[Solved] npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\Nuwanst\package.json’

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\Nuwanst\package.json’ in javascript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\Nuwanst\package.json’ Error Occurs?

Today I get the following error npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\Nuwanst\package.json’ in javascript.

How To Solve npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\Nuwanst\package.json’ Error ?

  1. How To Solve npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json' Error ?

    To Solve npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json' Error If you already have package-lock.json file just delete it and try again.

  2. npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json'

    To Solve npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json' Error If you already have package-lock.json file just delete it and try again.

Solution 1

Have you created a package.json file? Maybe run this command first again.

C:\Users\Nuwanst\Documents\NodeJS\3.chat>npm init

It creates a package.json file in your folder.

Then run,

C:\Users\Nuwanst\Documents\NodeJS\3.chat>npm install socket.io --save

The --save ensures your module is saved as a dependency in your package.json file.

Let me know if this works.

Solution 2

If you already have package-lock.json file just delete it and try again.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment