I’m encountering issues with my web application related to npm commands. Everything was functioning properly for a while, but recently, I’ve started getting errors when attempting to run npm start.
Initially, I receive this error message:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/justinlengvarsky/Desktop/Personal Portfolio/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/justinlengvarsky/Desktop/Personal Portfolio/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
Subsequently, when I attempt to resolve it by including a start command in my package.json file, I come across another error:
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
Here’s what my package.json file looks like:
{
"name": "personal-portfolio",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node your-script.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/LengvarskyJ/personal-portfolio.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/LengvarskyJ/personal-portfolio/issues"
},
"homepage": "https://github.com/LengvarskyJ/personal-portfolio#readme"
}
I’ve tried various methods to fix this, but nothing seems to help. What am I doing wrong?