Home > Net >  Cannot npm install after cloned repo
Cannot npm install after cloned repo

Time:06-15

Good evening,

after browsing for solutions myself during my Software Dev course in the past 4 months (newbie here and graduated last week as a Jr Software Dev) I am finding myself asking a question and hoping for help. I've searched around but could not find anything related.

For some reason I had to remove my classnotes/lab/project files from the Macbook I had been borrowing during my time at CodeClan. I also npxkilled 13GB of node_modules prior because I almost ran out of space.

Yesterday evening I wanted to git clone my portfolio (React App) and continue working on it. The usual git clone into new directory, then cd into the working directory, npm init -y and then npm install which failed already. A json.package or jason-lock.package was there. I got npm err 404 is not in the npm registry, which led me to set the registry and used my GitHub repo url for that (which is also a .io github page). Npm install would then tell me everything is up to date. Node modules weren't there at all, I removed both json packages and tried to npm install again, which usually works. I also used the npm cache clean / verify which did not do anything.

I then closed everything, went out of my working directory and updated node and npm. I updated node from 17.9 to 18.3 and npm from 8.8 to 8.11, restarted Mac again.

Via terminal created completely new directory for a Sandbox react app, cd into that and tried to npx create-react-app play-ground - not even that is working. It now comes back with following error messages, which is weird. It looks as if a completely new react app, which has nothing to do with my portfolio still wants to connect with that repo.

I removed the whole portfolio repo from this Mac and there should not even be a trace of it.

I hope I've explained my issues well enough. Instructors are not around anymore, lol and my partner who is also a Dev is a bit clueless as well. I appreciate any help and please bear in mind that I am a noob, still trying to read error messages and trying to solve them myself. However, I have been dealing with this react app issue since yesterday evening and I am running out of ideas.

Thanks a lot !!

➜  Sandbox la
total 0
➜  Sandbox npx create-react-app play-ground
npm ERR! code E404
npm ERR! 404 Not Found - GET https://annikaneumann.github.io/portfolio-annika/create-react-app
npm ERR! 404 
npm ERR! 404  'create-react-app@latest' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/annikaneumann/.npm/_logs/2022-06-14T17_02_55_107Z-debug-0.log
➜  Sandbox ```

CodePudding user response:

which led me to set the registry and used my GitHub repo url for that

That's most likely the problem, it means that npm will now use your Github repo as its main package repository, which it obviously isn't.

You should reset it so it points to the official NPM repository again:

npm config set registry https://registry.npmjs.org/

(I don't know if this will also solve your initial 404 error, but you'd have to provide more information on that if you want it solved)

CodePudding user response:

Thank you, that helped me creating a new react app. I did try to git clone and npm install my portfolio another time with a new working folder, but it would come back again with following error message. Both json packages are there but I can't install the node modules, no matter if I use the npm config set registry or not.

npm ERR! code E404
npm ERR! 404 Not Found - GET https://annikaneumann.github.io/portfolio-annika
npm ERR! 404 
npm ERR! 404  'homepage@https://AnnikaNeumann.github.io/portfolio-annika' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/annikaneumann/.npm/_logs/2022-06-14T18_44_36_110Z-debug-0.log
➜  annikaneumann.github.io git:(main) npm config set registry https://registry.npmjs.org/
➜  annikaneumann.github.io git:(main) code . 
➜  annikaneumann.github.io git:(main) npm start

> [email protected] start
> react-scripts start

sh: react-scripts: command not found
➜  annikaneumann.github.io git:(main) npm install
npm ERR! code E404
npm ERR! 404 Not Found - GET https://annikaneumann.github.io/portfolio-annika
npm ERR! 404 
npm ERR! 404  'homepage@https://AnnikaNeumann.github.io/portfolio-annika' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/annikaneumann/.npm/_logs/2022-06-14T18_48_21_895Z-debug-0.log
➜  annikaneumann.github.io git:(main) 
  • Related