I\'m trying to learn react, so I have this sample code for the full-stack react voting app, and I am trying to get it to work but after running npm install followed by npm s
The port is probably being used by another application, try listing and see if it's your application:
lsof -i:8080
You can kill the process of this port:
lsof -ti:8080 | xargs kill
Step 1: $ npm cache clean --force
Step 2: Delete node_modules by $ rm -rf node_modules package-lock.json
folder or delete it manually by going into the directory and right-click > delete / move to trash. Also, delete package-lock.json file too.
Step 3: npm install
To start again,
$ npm start
This worked for me. Hopes it works for you too.
PS: Still if it is there, kindly check the error it is displaying in red and act accordingly. This error is specific to node.js environment. Happy Coding!!
Delete node_modules and package-lock.json, and then run npm install. It worked perfectly here(run command below inside project root):
rm -rf node_modules && rm ./package-lock.json && npm install
Try to reinstall the cli package globally. In my case, I was trying to test a Vue.js tutorial when I get the same error message. The other thing I did was run the vue command again but this time using webpack-simple and that is why I am not sure wich one solved the problem but now it is working.
This solution fixed the error in Win10.
Please install globally npm install -g node-pre-gyp
My solution:
I was missing config.env
properties because I was developing on a new machine, and of course I keep my config files out of my repo.
If you are using a different machine than usual, make sure that you include any config files that are not present in the repo that gets cloned.