Could not resolve dependency: reactjs "npm install" on MacOS - node.js

I'm getting this error when I try to "npm install" in a reactjs app i'm trying to get running on my MacBook. I'm pretty new to working with reactjs and actually haven't coded for a really long time. But trying to get my feet wet again by setting up a development environment to work on an app that others have been writing so far.
Anyone know what the best way is to resolve this?
I'm hesitant to "force" it because I think that's likely to lead to a bunch of other issues. Want to go about this correctly. I have actually got this app running on remote servers running Linux before now and never had this issue.

There seems to be a conflict between the dependency versions in the project. Just run this as suggested in the error log:
npm install --legacy-peer-deps
If this doesn't work you'll have to take your chances and use the force flag. You can always go back if things don't work out
npm install --force

Related

how to install nodejs and npm on linux and have a working semver module

after trying to update nodejs because there was a problem with the semver module it was not working anymore. searching the internet revealed that there is something wrong with the installation. after removing nodejs as well as npm and installing them again i cannot run npm anymore as the binary is not found.
as far as i can tell there are multiple ways to install nodejs and npm and i am wondering which is the best way. i would prefer a method that does not rely on a package manager. also i might have trace amounts of previous nodejs installations left and i don't know how to get rid of them.
i don't know if this is important, but i need npm for a laravel project that is using vue. without it i would never have touch it.
thank you very much for any help!

The react-native init hangs on macOS Catalina, with fetchMetadata: sill resolveWithNewModule react-native#0.64.2 checking installable status

I just wanted to create a react native application using react-native init command. But it hangs with the message:
fetchMetadata: sill resolveWithNewModule react-native#0.64.2 checking
installable status
Sure I am not the first one facing the same issue and I found many answers and tried almost all solutions I found while googling it,
Examples are:
Uninstall and reinstall node
Install yarn
Clear npm cache
Install node using home-brew instead of direct installation
npm i -g react-native; then react-native init
and many other solutions, but it is still stuck.
It is not related to the MacOS version or Network connectivity etc anyway; because It worked on another machine with same OS, and on the same network.
I am sure the react native community is familiar with the question and may somebody will say this is already answered and thus will close it, but it still hangs. I don't know what the issue is.
I am not sure it is related to node or npm or some other. Because I faced the same issue, when I tried create-react-app.
I just wanted to know is there any solution to solve the issue?
and
is there anyway the node, npm or npx or other produce some error when it hangs for any reason, may be while downloading some dependency or while running some commands etc; and show some information regarding what is happened and what is missing.
Assuming this is more related to node, npm or npx; as these are responsible for downloading and running the modules and dependencies or it can be because of error handling in react-native init. Whichever, may be assuming everything fine on the machine, and may not be checking and reporting, if something is missing.
Screenshot: React Js and React-Native hangs
Few days after, surprisingly, it started working. I didn't change anything and I was planned to try a fresh installation of everything from OS installation. But now, I got it working, with no notable reason.

I cannot start my nestjs project after a reboot

I don't know what happened prior to this issue but after each reboot i have to fully remove npm and nodejs, reinstall both npm and nodejs in order to start my nestjs project.
After rebooting running the npm run start command in my nestjs project, npm stops halfway and exits without any error codes (Link below of the terminal output).
https://i.stack.imgur.com/zrbXp.png
What could it be? Is there perhaps some system path that gets wiped on reboot?
Any help or pointers would be greatly appreciated
Turns out both my angular project and my nestjs project required me to run a very specific version of node. anything else resulted in a silently crashing nestjs application with no errors.
For anyone stumbling into the same problem try fiddling around with the node version you're running
npm install -g n
n 10

Bundling errors after updating an npm package in React Native app

I'm building a React Native app which, at this point, doesn't have too many dependencies.
Every time I update an outdated npm package, I am GUARANTEED to run into bundling errors. It could be any package. I then spend hours trying different ways to clear npm cache, project cache, etc.
Does anyone else have this issue? Is there a "standard" set of commands I should run after upgrading ANY npm package? This is extremely frustrating!
This screen shot shows today's flavor of the issue:
BTW, I'm on Windows 10, using VS Code. My React Native version is 0.63.1, Node version is 14.7.0 and npm version is 6.14.7
UPDATE:
After a couple of hours of messing around and removing node_modules folder several times and issuing the following commands a few times, it's now started to work. Unfortunately, I can't put my finger on what fixed it. As I said, I did the same things a few times.
Here are the steps I repeated a few times -- though once should be enough:
Deleted the node_modules folder
In root folder, I ran npm cache clean --force
I then reinstalled all npm packages by running npm i
Went into cd android folder and ran ./gradlew clean
Then in project root, I ran npm start -- --reset-cache
Unfortunately, doing this the first time didn't fix the issue. It looks like I have to waste a couple of hours for things to get back to normal! Any idea how to make this problem go away for good?
I think this error is that you have not start the metro bundle. Try react-native start and then re-run the app

Getting started with Create React App - "Cannot find module"

I'm using the "Getting Started" guide because I've been experiencing endless errors trying to create a react app so far when following tutorials.
And straight away I'm running into a problem. When I run npx create-react-app my-app I get the following:
Cannot find module 'C:\Users\Aristophanes\node_modules\create-react-app\index.js'
Can anyone advise me what I'm doing wrong? Thanks.
This must be a problem related with your node installation (maybe you removed manually create-react-app package?). I'd recommend following these steps:
Uninstall node and npm
Delete the npm cache and npm modules in your machine (In Windows machine you can usually find them at C:\Users\ {username} \AppData\Roaming\npm-cache and C:\Users\ {user name} \AppData\Roaming\npm) respectively.
Install node and npm again
If you really don't want to delete node and npm, try step 2 and see if that works. Following these steps did the job for me, hope that helps you.
I think you might miss installing Node and npm in your machine.
I had same issue a few times. Every time I was searching thru net for a solution, and for every time i just typed in terminal
npm i node
and its just started working

Resources