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

Error code 127 ENOENT turned into react-scripts not found #8294

Open
callingmybluff opened this issue Aug 12, 2020 · 1 comment
Open

Error code 127 ENOENT turned into react-scripts not found #8294

callingmybluff opened this issue Aug 12, 2020 · 1 comment

Comments

@callingmybluff
Copy link

Bug description

Command

yarn start

What is the current behavior?

Step leading to the problem:

  1. Have been using the same project for awhile, and today I added package reactjs-popup while development server is running.
  2. Everything stopped and error code 127 appeared with error Error: ENOENT: no such file or directory*
    From that point forward, yarn did not work anymore
  3. After deleting node_module (and yarn.lock sometimes) and using yarn (or yarn install other times), I still got an error, but now it is that /bin/sh: react-scripts: command not found.

*The full error in step 2:

./node_modules/dom-lib/es/query/getPosition.js  
Error: ENOENT: no such file or directory, open '/var/www/html/teams/node_modules/dom-lib/es/query/getPosition.js'  

What is the expected behavior?

yarn start to start development server and finds react-script

Steps to Reproduce

  1. Use this package.json to do yarn install
  2. yarn start
{
  "name": "teams",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "node-fetch": "^2.6.0",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-localization": "^1.0.15",
    "react-scripts": "3.4.1",
    "rsuite": "^4.8.0",
    "styled-components": "^5.1.1",
    "styled-icons": "^10.14.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {}
}

Environment

  • Node Version: 10.14.1
  • Yarn v1 Version: 1.15.2
  • OS and version: Linux *** 3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Note

I even restarted my Linux for this, but did not help.
Sadly, the only solution that actually worked for me was npm install (and yarn start works perfectly after that). As far as I can understand: for some reason, yarn install is not installing react-scripts, unlike npm install. Currently I can't count on yarn as it does not work upon new cloning.

Let me know if you need anymore information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants