Skip to content
Advertisement

“npm install” not working for react project pulled from github

I’m on ubuntu 20.04.4 LTS. I’m trying to install locally a react project.

I tried to clone de repo from github, and install locally the react app, doing this :

git clone https://github.com/OpenClassrooms-Student-Center/7008001-Debutez-avec-React.git

then

npm install --verbose

But it just won’t work. this is the output :

npm verb cli   '/home/lblk/.nvm/versions/node/v17.6.0/bin/node',
npm verb cli   '/home/lblk/.nvm/versions/node/v17.6.0/bin/npm',
npm verb cli   'install',
npm verb cli   '--verbose'
npm verb cli ]
npm info using npm@8.5.1
npm info using node@v17.6.0
npm timing npm:load:whichnode Completed in 0ms
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:/home/lblk/.nvm/versions/node/v17.6.0/lib/node_modules/npm/npmrc Completed in 0ms
npm timing config:load:builtin Completed in 1ms
npm timing config:load:cli Completed in 2ms
npm timing config:load:env Completed in 0ms
npm timing config:load:file:/home/lblk/Documents/dev/javascript/7008001-Debutez-avec-React/.npmrc Completed in 0ms
npm timing config:load:project Completed in 16ms
npm timing config:load:file:/home/lblk/.npmrc Completed in 0ms
npm timing config:load:user Completed in 0ms
npm timing config:load:file:/home/lblk/.nvm/versions/node/v17.6.0/etc/npmrc Completed in 0ms
npm timing config:load:global Completed in 1ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:credentials Completed in 2ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 26ms
npm timing npm:load:configload Completed in 26ms
npm timing npm:load:setTitle Completed in 0ms
npm timing config:load:flatten Completed in 3ms
npm timing npm:load:display Completed in 8ms
npm verb logfile /home/lblk/.npm/_logs/2022-03-18T11_07_46_273Z-debug-0.log
npm timing npm:load:logFile Completed in 7ms
npm timing npm:load:timers Completed in 0ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load Completed in 43ms
npm timing arborist:ctor Completed in 1ms
npm timing idealTree:init Completed in 11ms
npm timing idealTree:userRequests Completed in 0ms
npm timing idealTree:#root Completed in 0ms
npm timing idealTree:buildDeps Completed in 2ms
npm timing idealTree:fixDepFlags Completed in 0ms
npm timing idealTree Completed in 15ms
npm timing reify:loadTrees Completed in 16ms
npm timing reify:diffTrees Completed in 1ms
npm timing reify:retireShallow Completed in 1ms
npm timing reify:createSparse Completed in 0ms
npm timing reify:loadBundles Completed in 0ms
npm timing reify:audit Completed in 1ms
npm timing reify:unpack Completed in 0ms
npm timing reify:unretire Completed in 0ms
npm timing build:queue Completed in 0ms
npm timing build:deps Completed in 1ms
npm timing build Completed in 1ms
npm timing reify:build Completed in 1ms
npm timing reify:trash Completed in 0ms
npm timing reify:save Completed in 1ms
npm timing reify Completed in 39ms
npm timing command:install Completed in 41ms
npm verb stack Error: ENOENT: no such file or directory, open '/home/lblk/Documents/dev/javascript/7008001-Debutez-avec-React/package.json'
npm verb cwd /home/lblk/Documents/dev/javascript/7008001-Debutez-avec-React
npm verb Linux 5.13.0-35-generic
npm verb argv "/home/lblk/.nvm/versions/node/v17.6.0/bin/node" "/home/lblk/.nvm/versions/node/v17.6.0/bin/npm" "install" "--verbose"
npm verb node v17.6.0
npm verb npm  v8.5.1
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/lblk/Documents/dev/javascript/7008001-Debutez-avec-React/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/lblk/Documents/dev/javascript/7008001-Debutez-avec-React/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 
npm verb exit -2
npm timing npm Completed in 302ms
npm verb code -2

npm ERR! A complete log of this run can be found in:

I searched a while but I just don’t understand… As you might have understood from the repo I’m trying to install, I am learning coding and react 🙂

Thanks for your help

Advertisement

Answer

Change your branch to one of the assignment ones like: https://github.com/OpenClassrooms-Student-Center/7008001-Debutez-avec-React/tree/P2C2-Begin

You current branch does not have a package.json file like the error says and therefore you cant install node modules

Advertisement