I wanna run this project in my local machine
https://github.com/Logician724/Mini-Ebay
But this project was developed 2 years ago
Can i run this project on my local machine where angular 9 and node 12 are installed or should I downgrade both of them to match the project's version?
And should i even downgrade my npm version?
The angular version doesn't matter as Node will download your dependencies based on package.json.
You could have issues with the Node version. I recommend you to install with you current version of Node and check if it runs or or if it doesn't.
If it doesn't then you need to update some of the dependencies. Which you should anyways if you are planning to revive and old project.
You can also look into Docker to run it in a container with a Node version from two years ago. This may be easier and quicker than upgrading the dependencies and the code. (And neater too.)
In general you would not want to downgrade you development environment. We should go forward rather than backward.
Related
I would like to upgrade a few projects from Node 8 to the latest Node version.
Amazon mentioned that Node 12 is now deprecated.
I assume there is much more to consider than simply upgrading the package version, considering these projects would have many packages installed and there could be breaking changes.
What is the approach I should take in upgrading them to the latest Node version without breaking existing functionality?
Updating
It depends on how are you running Node. If it is inside a docker container, you may update the image definition in your docker.compose file:
(note: I am using 16 as demo here)
# specify the node base image with your desired version node:<version>
FROM node:16
If you have it deployed as a Node project, you can set the engines field in your package.json:
"engines" : {
"node" : ">=16.0.0"
}
Lastly, if we are speaking about your local computer, you can uninstall Node and re-install the wanted version or use a version manager, like nvm.
Updating locally with nvm:
nvm install 16.0.0
nvm use 16.0.0
Considerations
Make sure everything works and that your dependencies can run in the new environment. A robust test suite and a proper CD/CI pipeline are essential to guarantee appropriate functioning.
$ yarn global add n
$ n latest
or
$ npm install -g add n
$ n 18
n allows you to manage several node versions with ease, i've been using it for years
Tried to fire up a new react app yesterday using create-react-app. Unfortunately, when I used the command npx create-react-app my-app, it says "Create React App requires Node 14 or higher." However, when I try to update to Node 14 or any later version, it says Windows 8 or higher is required to update. Since I'm on a work PC, it is a slow process to get my computer upgraded to Windows 10 and might affect other software I have on my computer.
I've been trying to understand Webpack and Babel but having a lot of issues that don't pop up with create-react-app. Is there any way to use create-react-app on Windows 7?
Thanks in advance.
The current latest release of the create-react-app project is v5.0.0 where support for Node 10 & 12 was dropped.
The only solution you have here, other that upgrading to a newer version of Windows and installing Node 14 is to use an older version of create-react-app.
The newest version that supports Node 10 & 12 is v3.4.0.
You can initialise your project using the older version with this command:
npx create-react-app#3.4.0 my-app
Note that this is not the latest version, and therefore is outdated and will not include the latest features of create-react-app.
Is you want to Use Node and react Js on Windows 7 32 bit system.Then just install following versions of node and create-react-app.
use Node 13.12.0
and to create react app use create-react-app version 3.4.0
npx create-react-app#3.4.0 my-app
this is working without any error and tested till installations
Otherwise consider upgrading your system as well as your software.
I am quite new to NodeJS and am planning to upgrade NodeJS version for my current project. The most recent NodeJS LTS is installed using NVM.
I need to keep switching between the current LTS that i am using and the new LTS that has been installed. I understand that i can do 'NVM use' for this purpose. npm-shrinkwrap.json is being used to lock down the npm package dependencies.
I am planning to follow the below approach both in my dev machine and build machine;
Is it okay? If not, please suggest a best approach.
nvm use latest_LTS
Update the package.json to pick the version which is supported by
latest_LTS
npm install
generate testing_build
Whenever i need to generate a build for current release (with the previous LTS NodeJS)
nvm use currently_used_LTS
clear the node modules
npm install (Release npm-shrinkwrap.json)
generate release_build
Thanks
In theory that should work.
However have you considered the option of just doing a point release for the current release_build that does nothing except version-bump node?
You may find (after re-running your tests) that the latest version of node is backwards compatable with release_build (or only requires minor fixes), and you can simplify your life by porting everything to the latest node version, rather than constantly switching
System: CENTOS7
I'm working on our TEST system that has a version of node prior to 8.9.
The application which I'm working on uses node 8.9.
The application runs fine when deployed out to Tomcat.
The issue is that I'm unable to just run 'ng serve' because the system sees v6.x.x.
Is there a way that I can modify my project to see the packaged node v8.x so I can run the ng options?
I'm instructed to not modify the system settings.
UPDATE
Just so others know what I ended up doing was modifying my bash script to include in the PATH ./node_modules to where node was in the local project. This is always the same path for whatever project and its version on node.
I did that for a while until a few months ago when we finally had rights to do things differently and are now using Node Version Manager
Install nvm (node version manager) to centOS
Then you will can install many version of node in your system
In this case you have to alias default version of node in nvm setting with version you want
tl;dr
Is there is a reason that I shouldn't do the following; Install and manage packages with a version of npm that is different (much newer) from the npm version that comes with the node version I am going to be using to run my app.
longer
Some context why I am asking. I have to work with a service that supports only node 0.10.32 (I know, don't ask) and an app that was written some time ago. We need to add some functionality and unfortunately when I try to run the codebase locally it does not because some dependency of some dependency updated the minor version and they introduced const or fat arrow notation (=>). We had used shrinkwrap to lock down the versions but something must have slipped.
I have spent days on this and at some point it came to me that the problem lies with the package manager not doing what I want. So I managed to install the packages I wanted and shrinkwrapped it using npm#3.10.10 which is what I get when I use node#6.12.3 (nvm use 6.12.3). And when I want to run the app I just switch to the node#0.10.32 to make sure that is going to work on the service.
Can anyone think of any problems with this solution or a reason I shouldn't do that?
Side question
I noticed that when installing node versions using nvm, they usually come with a specific version of npm? What is the relation of those versions? How are they decided? Was it the latest npm version along with that node version when it was released? Is it the latest version of npm that can run with that specific version of node?