npm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
npm ERR! npm star # Mark your favorite packages
npm ERR! npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
npm ERR! A complete log of this run can be found in: /Users/nishayadav/.npm/_logs/2023-10-04T04_39_09_845Z-debug-0.log
If I use npm run start
then it is giving error –
Compiled with problems:
×
ERROR in ./src/logo.svg
Module build failed (from ./node_modules/@svgr/webpack/lib/index.js):
Error: EACCES: permission denied, open '/Users/nishayadav/.config/svgrrc'
How to solve this??
2
Answers
The first error "npm ERR! Missing script: "start"" indicates that there is no "start" script defined in your package.json file. To solve this, you can either add a "start" script in your package.json file or use an existing script that serves as an entry point for your application.
To add a "start" script, open your package.json file and add the following code in the "scripts" section (code block 1 below):
Replace "your-entry-file.js" with the filename of your entry point file (e.g., "index.js" or "app.js").
If you already have a script that serves as the entry point for your application, you can use that script instead of "start" when running your app. For example, if your entry point script is called "server.js", you can run your app using (code block 2 below):
Regarding the second error "Error: EACCES: permission denied, open ‘/Users/nishayadav/.config/svgrrc’", it seems to be related to permission issues when trying to open the ‘/Users/nishayadav/.config/svgrrc’ file. To solve this, you can try the following steps:
(see code block 3 below)
This will run the command with administrator privileges.
(see last code block below)
Replace "your-username" with your actual username.
By following these steps, you should be able to solve the missing "start" script error and also fix the permission issue related to the ‘/Users/nishayadav/.config/svgrrc’ file.
Addressing your issues step by step :
Missing your start script.
In your package.json :
{ "scripts": { "start": "your-start-command" } }
replace it with your start command.
Check your permissions (you may need to use chmod).
Run npm using a sudo command.
Fix Ownership :
sudo chown -R your_username /Users/nishayadav/.config
Delete temporary files