Just check if you are in the correct folder. For me, when I had the same error, I was not in the same directory as the package.json file. Hence, my npm was not able to find it.
Once i had changed the directory. the issue got solved.