Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ER: Local Dev Environment not responding #1633

Open
freaky4wrld opened this issue Apr 30, 2024 · 2 comments
Open

ER: Local Dev Environment not responding #1633

freaky4wrld opened this issue Apr 30, 2024 · 2 comments
Assignees
Labels
feature: Infrastructure Secrets, Prod and Dev setup, etc. role: Dev Lead size: 3pt Can be done in 13-18 hours

Comments

@freaky4wrld
Copy link
Member

Overview

As a developer when I was trying to fire up the local dev environment it's not responding as usual. Instead the frontend doesn't load the contents.

  • At first it's not throwing any errors but later on it displayed the below mentioned error message
yarn start
yarn run v1.22.19
$ concurrently "cd backend && npm run start" "cd client && npm run start"
[0] 
[0] > vrms-server@0.3.0 start
[0] > node server.js
[0] 
[1] 
[1] > vrms-client@0.3.0 start
[1] > dotenv -e .env -e ../backend/.env -- cross-var cross-env PORT=%CLIENT_PORT% react-scripts start
[1] 
[1] node:events:491
[1]       throw er; // Unhandled 'error' event
[1]       ^
[1] 
[1] Error: spawn react-scripts ENOENT
[1]     at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
[1]     at onErrorNT (node:internal/child_process:485:16)
[1]     at processTicksAndRejections (node:internal/process/task_queues:83:21)
[1] Emitted 'error' event on ChildProcess instance at:
[1]     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
[1]     at onErrorNT (node:internal/child_process:485:16)
[1]     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
[1]   errno: -2,
[1]   code: 'ENOENT',
[1]   syscall: 'spawn react-scripts',
[1]   path: 'react-scripts',
[1]   spawnargs: [ 'start' ]
[1] }
[1] cd client && npm run start exited with code 1
[0] Mongoose connected from runServer() and is listening on 4000

Potential Suggestions

@Spiteless suggested the below solutions

  • setting up the local development again
  • clearing yarn cache
  • uninstalling the yarn and then reinstalling it again
@github-actions github-actions bot added this to New Issue Approval in VRMS - Active Project Board Apr 30, 2024
@Spiteless
Copy link
Member

Overview

Seems likem the error is indicating that the node is unable to locate react-scripts.

When plugging the error into Copilot it sends back

The error message Error: spawn react-scripts ENOENT typically means that the system can't find the react-scripts package, which is a set of scripts from the create-react-app starter kit.

meaning of ENOENT

ENOENT is a standard error code in Unix-like operating systems, and it stands for "Error NO ENTity" or "Error NO ENTry".

Provide Further Info

  • Can you also provide us with the results of pwd in your terminal before you run yarn start?
    • Wanting to confirm you're starting from the root. Other resources I've taken a peek at are indicating that this error sometiems come up when the node is run outside the application folder.
  • Can you provide us with the results of running the front end and back end separately
    • terminal 1 cd backend && yarn start
    • terminal 2 cd client && yarn start

Additional Things to Try

  • What happens when you install the app with npm instead of yarn ?

Observations

  • It looks like the backend is working from this error code, but from when you and I were troubleshooting the front end seemed to run and the backend wasn't working.

Sorry this is happening, hopefully we can get it resolved soon!

@JackHaeg JackHaeg added this to the 05.01 Team Workflow milestone May 7, 2024
@JackHaeg JackHaeg added feature: Infrastructure Secrets, Prod and Dev setup, etc. size: 1pt Can be done in 4-6 hours role: Front End role: Dev Lead and removed role: Front End labels May 7, 2024
@JackHaeg JackHaeg moved this from New Issue Approval to Prioritized Backlog in VRMS - Active Project Board May 7, 2024
@JackHaeg JackHaeg moved this from Prioritized Backlog to In progress in VRMS - Active Project Board May 7, 2024
@freaky4wrld
Copy link
Member Author

freaky4wrld commented May 7, 2024

Provide Further Info

  • Can you also provide us with the results of pwd in your terminal before you run yarn start?

    • Wanting to confirm you're starting from the root. Other resources I've taken a peek at are indicating that this error sometiems come up when the node is run outside the application folder.
  • Can you provide us with the results of running the front end and back end separately

    • terminal 1 cd backend && yarn start
    • terminal 2 cd client && yarn start

Additional Things to Try

  • What happens when you install the app with npm instead of yarn ?
  • The result of pwd:
freaky4wrld@Admins-MacBook-Air VRMS % pwd
/Users/freaky4wrld/hfla/VRMS
  • result from frontend
freaky4wrld@Admins-MacBook-Air VRMS % cd client 
freaky4wrld@Admins-MacBook-Air client % yarn start
zsh: command not found: yarn
freaky4wrld@Admins-MacBook-Air client % nvm use 16
Now using node v16.20.2 (npm v8.19.4)
freaky4wrld@Admins-MacBook-Air client % yarn start
yarn run v1.22.22
$ dotenv -e .env -e ../backend/.env -- cross-var cross-env PORT=%CLIENT_PORT% react-scripts start
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: spawn react-scripts ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:485:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
    at onErrorNT (node:internal/child_process:485:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn react-scripts',
  path: 'react-scripts',
  spawnargs: [ 'start' ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  • result from backend
reaky4wrld@Admins-MacBook-Air VRMS % cd backend 
freaky4wrld@Admins-MacBook-Air backend % yarn start
zsh: command not found: yarn
freaky4wrld@Admins-MacBook-Air backend % nvm use 16
Now using node v16.20.2 (npm v8.19.4)
freaky4wrld@Admins-MacBook-Air backend % yarn start
yarn run v1.22.22
$ node server.js
Mongoose connected from runServer() and is listening on 4000

Things to notice while troubleshooting

  • I saw a solution to look into the client/node_modules directory for the react-scripts and I didn't find it
freaky4wrld@Admins-MacBook-Air client % ls node_modules/react-scripts
ls: node_modules/react-scripts: No such file or directory

@JackHaeg JackHaeg added size: 3pt Can be done in 13-18 hours and removed size: 1pt Can be done in 4-6 hours labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: Infrastructure Secrets, Prod and Dev setup, etc. role: Dev Lead size: 3pt Can be done in 13-18 hours
Projects
Development

No branches or pull requests

3 participants