switching node version in linux for VS Code installation - node.js

I'm trying to install VS Code on a Raspberry PI (Pi 3).
I got the Raspberry Pi OS with some pre-installed node application that I want to debug and extend the functionnality.
There for i thought it would be great to have VS Code Server running on the Pi so that i don't have to have the Pi connected to the Internet all the time in order to do the remote-ssh (and this option didn't even work).
The "Blackbox" application that I want to debug / extend the functionnality runs with node v7.10.0.
Or at least that's what node -v tells me.
I've tried to install nvm in order to switch node versions to be able to install VS Code Server.
I've done the nvm install 12.0.0 (as VS Code Server says it requires at least node v12) and the nvm use v12.0.0. I've tried to use nvm alias default v12.0.0 aswell, but still if i type node -v it gives me the v7.10.0. The installation of VS Code server doesn't succeed as it is most probably using the node version installed directly in the linux.
Is there anything i can do in order to have the node -v giving out v12.0.0 so that VS Code can install properly?
VS Code thereafter probably need to use this version (v12.0.0) to operate but the "blackbox" node project still needs to run with node version v7.10.0 (I don't know it it supports anything higher that that).
I thought that nvm is controlling the node versions that and that i would be possible to run two different node versions beside each other or at least switch between them.
Is there anything I can do to install VS Code Server?

Related

NodeJS can't install it properly

I had problem with create-react-app and turned out I gotta update my version of nodeJS. The thing is that I can't do so. when I type node --version I get v11.10.0, however when I type sudo n stable, I get:installed : v10.16.3 (with npm 6.9.0).
However when checking version of node I all time get this 11.10.0. How can I get this last stable version 10.16.3?
EDIT: SOLVED
turned out nvm was installed on laptop and it controled node version
I would suggest you use nvm to manage your node versions. It allows you to download multiple versions and you can assign versions on a per project basis. It also allows you to choose which version you want as default
Install nvm it will allow you to install and use any version you want.
Installation steps on ubuntu 18.04

Angular - How can I specify a different node.js version than what is installed on the system?

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

Installing Node JS on Windows 7 stuck on a command prompt

I'm trying to install Node JS v8.12.0 on Windows 7, using the following installer downloaded from the Node website: https://nodejs.org/dist/v8.12.0/node-v8.12.0-win-x86.zip
When I run the installer, it just hangs on the first window it opens - please see screen below.
It may have something to do with the fact that I uninstalled a previous version of Node by following this solution: How to completely remove node.js from Windows
I also had NVM for Windows installed previously, which I also uninstalled.
So I am trying to install Node again from scratch, but this time it just hangs forever.
I'm running it with Elevated Privileges on a work machine, which has always worked when installed Node in the past, including this version (8.12.0).
I guess you are using the binary version of Node for Windows.
Try to download and use this installer:
https://nodejs.org/dist/latest-v8.x/node-v8.15.0-x86.msi

I installed node.js v5.12.0 but the version showing v0.12.2

I installed Node.js from (https://nodejs.org/dist/latest-v5.x/node-v5.12.0-x64.msi), but the issue is , its showing version v0.12.2 instead of v5.12.0 which is required.
I try to update the node.js 5.2 installer but still showing version v0.12.2.
I have uninstalled Node.js and reinstall node-v5.12.0-x64.msi but still it’s not updated. Due to this am not able to run further commands for Ionic environmental setup.
Open a terminal and type where node
It should point to an old version of node (v0.12.2) still installed on your computer, for example C:\bin\node.
As Node.js is portable, you can have multiple versions on your computer.
If it cannot be uninstalled, simply delete C:\bin\node folder.
Then:
Open Windows System Properties/Advanced system properties
Click on Environment variables and edit PATH variable
Remove inside its value the path of the old version of node (C:\bin\node in our example).
Re-install Node v5.
Close your terminal and open a new one then type where node, it should point to Node.js v5
Most likely, you have an old Node version for x86 platform, and you are installing a newer version for 64 bit. Remove the path to the x86 from the Paths env variable, or move it to after the 64 bit path.
Solution:
List node.js installatios using nvm:
nvm ls
High chance the version you tried to install is also listed
Select the version to use using nvm
nvm use
(Not a direct solution)
You can try to install using nvm
Uninstall nodejs and follow the instruction from https://github.com/coreybutler/nvm-windows

I cannot run micro in terminal although it is installed global

I tried https://github.com/zeit/micro
and unable to run npm start
I run micro in terminal and also see the error
I type in terminal "micro"
Response :
/usr/local/lib/node_modules/micro/bin/micro.js:33
let file = args.sub[0]
SyntaxError: Block-scoped declarations ...
The error message looks as if you were using a version of Node.js that is not up-to-date. So, update your installation of Node.js, and everything should be fine.
Just in case you don't do that yet, have a look at the Node Version Manager which makes installing and managing different versions of Node.js a breeze. If you have installed it on your local system, installing the current version of Node.js becomes as easy as:
$ nvm install 7.5.0
(Or whatever the current version of Node.js is when you read this answer.)

Resources