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_mod
Delete package-lock.json
it works for me
then npm install
if your node_modules got installed in say /home/UserName/ like in my case,
your package-lock.json file will also be there. just delete this file, go back to your app folder and run npm init
and then npm install <pkgname>
(e.g express) and a new node_modules folder will be created for your.
If your folder already have
package.json
Then,
Copy the path of package.json
Open terminal
Write:
cd your_path_to_package.json
Press ENTER
Then Write:
npm install
This worked for me
You need to make sure if package.json file exist in app folder. i run into same problem differently but solution would be same
Run this command where "package.json" file exist. even i experience similar problem then i change the folder and got resolve it. for more explanation i run c:\selfPractice> npm start whereas my package.json resides in c:\selfPractice\frontend> then i change the folder and run c:\selfPractice\frontend> npm start and it got run
If you already have package-lock.json
file just delete it and try again.
You can use npm init to create a package.json.