Skip to content
Advertisement

npm WARN enoent ENOENT: no such file or directory, open ‘C:UsersNuwanstpackage.json’

I just want to install socket.io to my project which is located on 3.chat folder. But when I run following command it shows following Warnings.And its not created a node_modules directory inside my project folder. How to fix this?

C:UsersNuwanstDocumentsNodeJS3.chat>npm install socket.io
C:UsersNuwanst
`-- socket.io@2.0.3

npm WARN enoent ENOENT: no such file or directory, open 'C:UsersNuwanstpackage.json'
npm WARN Nuwanst No description
npm WARN Nuwanst No repository field.
npm WARN Nuwanst No README data
npm WARN Nuwanst No license field.

Advertisement

Answer

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

C:UsersNuwanstDocumentsNodeJS3.chat>npm init

It creates a package.json file in your folder.

Then run,

C:UsersNuwanstDocumentsNodeJS3.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.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement