nodemon: command not found
I am trying to run a project [which I built in VS code] in Replit so I can show the output of code as part of my portfolio; however, I cannot fathom for the life of me how to fix the below [I’m quite new to coding], so would be grateful for any advice. I thought it might be a problem with the package.json file [I added “start”: “nodemon index.js”] but still no dice…
https://boilerplate-project-filemetadata-2.lewismander.repl.co
npm run start
[email protected] start
nodemon index.js
sh: line 1: nodemon: command not found
exit status 127
It appears that the
nodemon
command is not found even though you have added
"start": "nodemon index.js"
to your
package.json
file.
This could be because
nodemon
is not installed globally or not installed locally in the project’s directory. Here are some steps you can try:
Install
nodemon
locally in the project’s directory by running the following command in the terminal:
cssCopy code
npm install nodemon --save-dev
This will install nodemon
as a development dependency and add it to the devDependencies
section of your package.json
file.
2. Modify your package.json
file to use the local nodemon
binary by updating the start
script to:
jsonCopy code
"start": "node_modules/.bin/nodemon index.js"
This tells the script to use the nodemon
binary that is installed in the project’s node_modules
folder.
3. Run npm run start
again and see if the error is resolved.
If you still encounter the same error, it could be that there is a problem with your Replit environment configuration. You may want to check that nodemon
is properly installed and configured in your Replit environment.
Thanks for your help. I followed the steps you outlined, however, we now have a new error…
Replit: Updating package configuration
→ npm install @mui/material redux-persist scenes yup react-redux react-router-dom components @reduxjs/toolkit react-dom react-dropzone state @mui/system formik react @mui/icons-material
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm run start
[email protected] start
node_modules/.bin/nodemon index.js
sh: line 1: node_modules/.bin/nodemon: No such file or directory