React version issue. Not able to upgrade version - node.js

I am not able to install latest version of react. Actually I installed a particlar version after appending # , after that what ever I am doing it is not working. even I unistalled nodejs completely. still it is not working.
npm react --version
6.14.15
Then I ran this
npm install --save react#latest
After that version is still coming same.
npm react --version
6.14.15
After that I uninstalled react using below
npm uninstall -g create-react-app
I also did
npm uninstall react
and then checked the version. it is still coming same.
I followed onw blog and tried below. still it dint work.
npm install react-scripts#4.0.0 react#17.0.0 react-dom#17.0.0
and installed react again. still it is giving same version.
Could you please help me on the same.
Is there any to remove it completely from the system?

Let understand the diff between react and create react app.
React is a js library for creating user interfaces but and create react app is a cli tool that help us to create the files template for a react project and both are totally different npm packages.
The create react app doesn't depend on react so it doesn't install the required version of react.
If you want to upgrade your react library you have to install react
npm i -g react#latest

Related

Errors when updating angular version 10 to 11

I've been updating the version of an angular version, I used the angular update guide, and used ng update #angular/core#11 #anuglar/cli#11, for the most part I was able to get it all done but when I try and do ng server, I get this error Picture of terminal error
Here is my Package.json
Packag.json
I have tried deleteing node modules and packag-lock and doing npm install, but I still get the same error when doing ng serve.
I know that my #angular/material isn't the same version as the rest of my angular, when I update my material version it just causes more and more errors.
Your node modules are probably still cached. Try the following command
npm cache clean --force
then do npm install again

Angular "npm i" Unsupported engine error message

I am trying to install all the dependencies of my angular application.
Now once I enter npm i to install all the dependencies I am receiving this error message.
Initially, I thought this is an issue with Installing Angular CLI globally using npm, so I run the
npm install -g #angular/cli
and I received this message -
Now anyone has any idea what is wrong with the angular CLI message and also what do I need to do to successfully install the npm i to my angular application successfully?
Angular requires an active LTS or maintenance LTS version of Node.js:
https://angular.io/guide/setup-local#prerequisites.
So install LTS releases of Node.js: https://nodejs.org/en/about/releases/
yes you have the wrong version of #nguniversal and its not compatible with the current version of angular you have which looks to be 12.x.
so you have to type for good measure:
if any have an error its because one of the packages are not there and that's okay with the next step
npm uninstall #nguniversal/common
npm uninstall #nguniversal/builders
npm uninstall #nguniversal/express-engine
now type
ng add #nguniversal/express-engine
that's it it will add itself - there is still a lot of work post this though so please follow these instructions carefully.
https://angular.io/guide/universal

npm installing wrong version of anuglar(8.1.0)

when i run the following command, it shows 6.4.1.
npm run ng --version
but when i am running the following command, it is installing 8.1.0 and getting error. i do not understand how it is happening.
npm install -g #angular/cli
i tried the following commands. but it is not working
npm cache clean --force
npm install -g #angular/cli
Error Screen
My Requirement:
Angular 6
how can i resolve this?
You should the latest (12+) node when upgrading to angular 8. You can download it from here.
After upgrading node, the issues should go away.
For simple use cases and thanks to the work done in Angular 8, you can upgrade to the latest release using one command:
$ ng update #angular/cli #angular/core
After running this command, the lazy loaded routes will be automatically migrated to the new import syntax which is standard compliant and brings Angular close to the open web platform.
You also need to be aware of the following issues when upgrading your project:
Angular 8 makes use of the latest TypeScript 3.4, so even if the upgrade process completes with success you might have some syntax errors that may be due to the better type inference system used by the latest version which detects new potential typing issues but in the end this will improve your code quality and helps you avoid bugs in the future. You can see the new features of TypeScript 3.4 from the official docs.
You need to have Node.js 12+. Simply run node -v to verify your Node version. You can install the latest version from the official website

Does it have an issue if you install angular, reactjs, ionic, apache-cordova and karma in node js?

Does it have an issue or conflicts if you install ionic and angular and then you install reactjs, apache-cordova and karma in npm ?
If you install these packages on the same project you may have issues. All these frameworks are meant to work independent and you shouldn't use Angular if already using React or vice versa for instance.
If the packages are installed on different projects, then you are good to go. The package is only used by the project you installed it on (you can find all the packages installed for a project on the node_modules folder inside your project).
I think there would be no issues as long as you install them globally. just add -g every time you npm install something.

npm peerDependencies React : can't install any packages

I'm building new React App to learn and play with Draft-js, RichStyle Text Editor.
I used create-react-app to initialize my React application. It's working, and very easy to use.
Now, I tried to add semantic-ui-react, which is React version of SemanticUI lib.
Aaaaannd fail.
npm install semantic-ui-react --save
As you can see, same effect for draft-js.
My issue is that normally there's no problem to use draft-js & semantic-ui-react with React 15.4.2. I use this stack in professional env.
Is there something I'm missing with npm ? Is create-react-app can stop this install ?
Now, I can't install any packages. This error shows up everytime. But, I cant still npm start for my local web server. I also tried npm cache clean
Is my very simple package.json
Thanks again for you help.
Solution : Just update NPM and everything working.
Edit : My App folder :
And my npm & node version
My guess is that you have old npm or node versions, you can't start the project with this versions... you can upgrade npm and node programs.
if you are using brew on OSX then you can use following commands to upgrade them.
brew update
brew upgrade node
npm install -g npm

Resources