Reputation: 43
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
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
Reputation: 335
When you are trying to run react app cloned from github, follow these steps.
npm install
to install all the dependencies.npm start
Upvotes: 1
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
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
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