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?
JavaScript
x
10
10
1
C:UsersNuwanstDocumentsNodeJS3.chat>npm install socket.io
2
C:UsersNuwanst
3
`-- socket.io@2.0.3
4
5
npm WARN enoent ENOENT: no such file or directory, open 'C:UsersNuwanstpackage.json'
6
npm WARN Nuwanst No description
7
npm WARN Nuwanst No repository field.
8
npm WARN Nuwanst No README data
9
npm WARN Nuwanst No license field.
10
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.