Everest Software LLC
Everest Software LLC

Reputation: 43

Can't start a cloned react app

I just cloned a react app to my local computer from github, but when I go to run an npm start on it, I get this error:

   ➜  sweet-movie-app git:(master) npm start
internal/modules/cjs/loader.js:596
    throw err;
    ^

Error: Cannot find module '../lib/utils/unsupported.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
    at Function.Module._load (internal/modules/cjs/loader.js:520:25)
    at Module.require (internal/modules/cjs/loader.js:650:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:19:21
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:145:3)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)

I am not sure if it is something that is missing globally, or if it is something wrong with the local repo or npm. Package.json

{
  "name": "sweet-movie-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "material-ui": "^0.20.0",
    "react": "^16.2.0",
    "react-bootstrap": "^0.32.0",
    "react-dom": "^16.2.0",
    "react-redux": "^5.0.6",
    "react-scripts": "1.1.0",
    "redux": "^3.7.2",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.2.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

Upvotes: 4

Views: 24099

Answers (5)

Talha Shah
Talha Shah

Reputation: 1

When you clone a react app repo from github the first step is to install all dependencies for that open terminal in your project's directory and run npm install this command will install all the dependencies in cloned repo. after the installation is complete type and run npm start to start you React app server and If it's a Vite app, use npm run dev instead this command will launch your React app in development mode.

Upvotes: 0

Tanmay Chavan
Tanmay Chavan

Reputation: 335

When you are trying to run react app cloned from github, follow these steps.

  1. First delete the package-lock.json
  2. Then run this command npm install to install all the dependencies.
  3. Then just make sure you are using lts version of nodejs
  4. Then after completing above process, run npm start
  5. DONE :)

Upvotes: 1

BlueStarx88
BlueStarx88

Reputation: 31

After cloning a repo, run npm install from your terminal in the directory which contains package.json file; this will install all the dependencies required for your application. Then run npm start.

Upvotes: 3

TechSavy
TechSavy

Reputation: 1340

When you clone the repository, run npm install from the project directory, and then npm start. This happens because the dependencies were not installed.

Upvotes: 2

Vishnu Jayan
Vishnu Jayan

Reputation: 376

Once you cloned the git repository try to install all modules using npm install from the directory of your app to avoid these kind of issues.

Upvotes: 8

Related Questions