Node JS 6.9 and angular CLI version compatibility - node.js

I have a restriction of using node JS version 6.9.1. I am getting many problems, while using angular cli quick start steps.
after ng serve, browser page will be white, no error in console.
npm start works, but if i change some style/file browser do not not refresh.
if i make any style change, webpack compiled successfully message comes but webserver fails to load page.
When I follow the quick start steps with latest nodejs it works like a charm. Can any one help me in telling, what are the versions (npm, angular-cli), I should use to run it ?
Like

Each Angular/Cli version has limited its compatibility of node versions below a specified release. If you have to use a specific version of node then your best bet would be to find a previous version of the Angular/Cli that will play nicely.
Here you can find all the versions and from there, pick one a little further back in the list and then do a search in google for "Angular/cli version x.x.x node compatibility" to see if there are any known issues.
Once you pick a version that looks good, run
npm install -g #angular/cli#<your version number>.
Once the install is complete run ng help and you'll get feedback right away if the version is still incompatible and you can try a different version.
Just make sure you get rid of the installs you aren't using with npm uninstall -g #angular/cli#<your version number>

for see if angular-cli is compatibility whit your node version installed you can see https://www.npmjs.com/package/#angular/cli/v/6.0.8?activeTab=versions, for example, I have installed node 6.11.2 and I have to use: npm install -g #angular/cli#6.0.0

Related

Node version different when using NPM

I tried to find a duplicate question, there are similar ones but I still don't understand what's going on..
I just installed node and npm on Ubuntu 20.04 with
sudo apt install nodejs npm
And followed the Electron quick start tutorial, and added this line to the beginning of my main.js:
console.log("node version: " + process.versions["node"]);
When I run my app with npm start, I see (both on the console and on the app) node version 16.13.0, but when I run the app with node main, I see the version as 10.19.0, which is also what node -v shows.
I can probably "fix" this issue by updating node, but I would like to understand what is going on here.. Is NPM using a different node version or something?
Thanks
Edit
I tried this with an empty node app, just made npm init and set start: "node index.js" in package.json, this time both node index.js and npm start show the same version (10.19.0) so I'm guessing Electron is somehow reading a wrong node version?
#DJHemath is spot on. Electron has Node and Chromium as internal libraries. IE: Node is a module of Electron.
Therefore, the version you are seeing within your Electron application is the Node version that is bundled with Electron.
When Electron is updated, the versions of Node and Chromium are often updated as well. An overview of this can be seen on the Electron homepage "Releases" cards (latest, beta, alpha and nightly).
Additionally, for historical purposes, version updates of these two dependencies can be seen on the Stable Releases page.
Thus, in summary, changing your system's installed Node version will not affect the version of Node used within your Electron application(s).

ReferenceError: primordials is not defined error when installing Semantic UI

I know that this question had been asked a lots of times (for instance - here), but either solutions didn't work or didn't fit my scenario.
The solution, offered in the link above, was:
Solution: Either upgrade to gulp 4 or downgrade to an earlier node.
So, here's what I have:
• Node: 12.18.1 (node -v)
• Gulp: CLI 2.3.0, Local version 4.0.2 (gulp -v)
I have created brand new react app:
npx create-react-app --template typescript react-app
Then I go to app folder (react-app) and execute the following command as on Semantic UI site:
npm install semantic-ui --save
However, I get the same error as in the question above. Here's the full output of this command:
If you don't want to roll back your version of Node, try using the actively maintained community fork of Semantic UI: Fomantic UI.
Run the command as you would with semantic-ui: npm i fomantic-ui
Fomantic is backwards-compatible with Semantic UI while resolving compatibility issues between Node 12 and Gulp 3 (which another thread references as being the root of the "primordials is not defined" issue).
Try going back to Node v10.
The thing is that Node v12 has a feature that is not compatible with Semantic-UI (Gulp 4.0.2), and that's why you get the error.
Please try upgrading your node.js to the latest version at https://nodejs.org/en/download/
and also run the following command npm install -g npm#7.0.9 or the latest version to update your npm.
After upgrading and updating Node and npm I installed semantic-ui without getting the primordial not defined error.

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

Can't create new Angular project

Installed the Angular CLI using this command
npm install -g #angular/cli
But when creating new project using command
ng new PROJECT-NAME
it shows
You are running version v8.0.0 of Node.js, which is not supported by
Angular CLI v6. The official Node.js version that is supported is
8.9 and greater. Please visit https://nodejs.org/en/ to find instructions on how to update Node.js.
But actually i am using nodejs v9.11.1
See screenshot of my cli
Mostly sounds like a version problem. The new angular cli version requires the latest version of node.
All you need to do is update node and npm to latest version , everything should work fine.
If you are working on windows I'd suggest just going on their site and getting the latest one(currently at the time of this post is 8.11.2). For linux based and mac I would suggest looking for a guide how to get latest version since installing from terminal with something like (apt-get install or yum) will not have latest version you need (can easily be changed with some simple commands)
Also do check the version of node with: node -v
There has also been a naming conflict on linux regarding node vs nodejs see this question.

Node and cordova mismatch

I'm trying to work on a really old cordova project(cordova 4.2.0) in Windows. In order to build the project I need an appropriate Node version.
I have tried a few versions from the distributions page by basically hit and trial but in vain. The error is the same.
404 for cordova repository www
Which version of node would work with cordova 4.2.0?
Screenshot here:
You have installed cordova 4.0.0 on machine, but your project requires and try to download 3.6.3, but that version is no longer present on npm package.
Use
npm show cordova#* version on console to show all available versions of Cordova, then upgrade your project to the nearest one (es. 4.0.0).

Resources