Kacper Faligowski
Kacper Faligowski

Reputation: 369

React - cloned repository npm install not working

I have an important repository on github (tutorial) and when I clone this repository and then npm install - npm start is not working. This is what I can see in the Terminal:

react-scripts start

sh: react-scripts: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR! 
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 ERR! A complete log of this run can be found in:
npm ERR!     /Users/kacperfaligowski/.npm/_logs/2020-03-19T01_09_33_794Z-debug.log

Trying to fix that but can't do anything for two hours. My npm version is - 6.4.1. I have to do that because can't do next steps on the tutorial. Please, help me. Thanks.

package.json:

{
  "name": "01",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@storybook/addon-knobs": "^5.0.3",
    "husky": "^1.3.1",
    "modern-normalize": "^0.5.0",
    "react": "^16.8.4",
    "react-dom": "^16.8.4",
    "react-scripts": "2.1.8",
    "styled-components": "^4.1.3"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "storybook": "start-storybook -p 9009 -s public",
    "build-storybook": "build-storybook -s public"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ],
  "devDependencies": {
    "eslint": "^5.12.0",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-config-prettier": "^4.1.0",
    "eslint-plugin-import": "^2.16.0",
    "eslint-plugin-jsx-a11y": "^6.2.1",
    "eslint-plugin-react": "^7.12.4",
    "lint-staged": "^8.1.5",
    "prettier": "^1.16.4",
    "@storybook/react": "^5.0.3",
    "@storybook/addon-actions": "^5.0.3",
    "@storybook/addon-links": "^5.0.3"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.js": [
      "prettier --config .prettierrc --write",
      "eslint --fix",
      "git add"
    ]
  }
}

Upvotes: 0

Views: 351

Answers (1)

Kacper Faligowski
Kacper Faligowski

Reputation: 369

My npm install couldn't install all dependencies from repository. I fixed that updating my npm globally using:

sudo npm install -g npm@latest

Upvotes: 1

Related Questions