node version difference between mac and linux - node.js

on my mac, key node -v, I get "v6.2.2", on centos, I get "v0.10.36", on centos, I keys "uname -a", I get "Linux VM_80_24_centos 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux", how can I understand the difference between two version num.

It seems like one is node version and another is npm version. You might executed the different commands.
To check node version:
node -v
will give 'v6.2.2'.
To check npm version:
npm -v
will give 'v0.10.36'.

Related

How to find node js location in mac M1?

I want to remove node to install it with nvm but I can't uninstall it.
I installed node twice, once I installed it wrong and the second time I did it right, I uninstalled one of the two nodes but the second time I don't know where it is and because of that I can't uninstall it.
I already try:
brew uninstall --force node
look tutorial how to uninstall node js from mac M1
Does anyone know how to find node location on mac M1 ?
It is dependent by your packet manager.
For example, asdf version manager show info like that:
asdf info nodejs
OS:
Linux slonzal 5.19.0-26-generic #27-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 23 20:44:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
SHELL:
zsh 5.9 (x86_64-ubuntu-linux-gnu)
ASDF VERSION:
v0.10.2-7e7a1fa
ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/home/slon/.asdf
ASDF INSTALLED PLUGINS:
nodejs https://github.com/asdf-vm/asdf-nodejs.git
yarn https://github.com/twuni/asdf-yarn.git main 376c540
Other version managers have own syntax. Try to npm -h, if you use npm.

Why does the Electron Quickstart App fail to start correctly on my Ubuntu instance?

I followed the following steps on a fresh installation of Ubuntu 20.10:
# Clone this repository
git clone https://github.com/electron/electron-quick-start
# Go into the repository
cd electron-quick-start
# Install dependencies
npm install
# Run the app
npm start
The output fromm the start command is:
up to date, audited 89 packages in 1s
found 0 vulnerabilities
> electron-quick-start#1.0.0 start
> electron .
(node:4081) electron: The default of contextIsolation is deprecated and will be changing from false to true in a future release of Electron. See https://github.com/electron/electron/issues/23506 for more information
The resulting window looks like this:
System Information:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.10
Release: 20.10
Codename: groovy
Linux andy-Parallels-Virtual-Platform 5.8.0-31-generic #33-Ubuntu SMP Mon Nov 23 18:44:54 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Node version: v15.3.0
Electron-quick-start commit hash: 2b0dbb098
After doing a Google Image search I found the cause and the current resolution:
https://github.com/electron/electron/issues/26061
This only happens on Parallels at a specific version.

How does Docker run a Linux kernel under macOS host?

I installed Docker on my macOS Sierra as follows. Note I don't have VirtualBox installed.
brew cask uninstall virtualbox
brew cask install docker
My macOS details.
$ uname -a
Darwin m-C02QG7TRG8WN.local 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
$ docker version
Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Tue Mar 28 00:40:02 2017
OS/Arch: darwin/amd64
Server:
Version: 17.03.1-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: c6d412e
Built: Fri Mar 24 00:00:50 2017
OS/Arch: linux/amd64
Experimental: true
Once I run Docker from launchpad, I am able to run Docker containers.
$ docker run -it ubuntu
root#2351d4222a4e:/# uname -a
Linux 2351d4222a4e 4.9.13-moby #1 SMP Sat Mar 25 02:48:44 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
My question is how does Docker manage to run a Linux kernel within macOS? I thought Docker would at least require boot2docker or some other such Linux kernel running so that it can create the Ubuntu's filesystem with the help of it. But the above output seems to indicate that it is not so. Where does the Linux kernel come from then?
While the other answers are correct about the hypervisor, they don't answer your specific question.
The answer is "Docker [Desktop] for Mac" does run a Linux host VM with a replacement for boot2docker - LinuxKit developed and maintained by Docker for the purpose of making lightweight distributions.
https://blog.docker.com/2017/04/introducing-linuxkit-container-os-toolkit/
The uname you saw didn't have the keyword in it, but it seems to be included now, e.g. from Docker for Mac 18.03.1 I see:
Linux a8e079429a51 4.9.87-linuxkit-aufs #1 SMP Wed Mar 14 15:12:16 UTC 2018 x86_64 Linux
You can see links to the included versions on the release pages.
https://docs.docker.com/docker-for-mac/release-notes/
So it's not so different from the old days Docker Machine + VirtualBox + boot2docker,
for the new days, it's just
the provisioning is done internally by "Docker [Desktop] for Mac"
and VirtualBox is replaced by Apple's Hyperkit,
and the "default VM" is a bit more tucked away.
The early version Docker used VirtualBox to run virtual machine for Docker. Since June 2016, the way to run Docker on Mac and Windows became much simpler, there's the official release introduction blog for Docker on Mac/Windows, and there's also some introduction from docker mac website:
Docker for Mac is a complete development environment deeply integrated with the MacOS Hypervisor framework, networking and filesystem.
And with the structure looks like:
Docker is using Apple's Hypervisor Framework: https://developer.apple.com/reference/hypervisor
More reading on the Docker blogs for when then came out last year: https://blog.docker.com/2016/05/docker-unikernels-open-source/

git on linux, Right path, wrong version number

[wen#localhost git-master]$ /usr/local/bin/git --version
git version 1.9.0.GIT
[wen#localhost git-master]$ which git
/usr/local/bin/git
[wen#localhost git-master]$ git --version
git version 1.7.1
Installed follow Getting-Started-Installing-Git
My linux dist info.
[wen#localhost git-master]$ uname -a
Linux localhost.localdomain 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[wen#localhost git-master]$ cat /etc/centos-release
CentOS release 6.5 (Final)
What's wrong with this ?
BTW, I installed the Development Tools which contains Git 1.7.1.
Follow below, I resolve the problem.
yum remove git
exit
# reopen an terminal
Now, everything is ok :-)
EDIT
Actually, the problem is caused by hash(man hash,help hash),
you can clear all cache by hash -r, or only one cache hash -d git.
But, I think, remove the old version is not bad,saved my disk prevent the conflict.

How do I know which Linux package to install for my Linux AMI

Ubuntu/Debian
Red Hat/Fedora/CentOS
Mac OS X
openSUSE
FreeBSD
OpenBSD
Gentoo
I have an application which has been natively packed on the above platforms, how do I know which one to install on my Linux AMI on EC2.
uname -a displays the following
Linux ip-10-315-48-29 3.7.31.31-83.9.amzn1.i686 #1 SMP Sat Feb 18 20:11:16
UTC 2011 i686 i686 i386 GNU/Linux
It's obviously some kind of Linux, so look for a file in /etc that ends in -release or _version:
ls /etc/*-release /etc/*_version
That should help you determine which Linux distribution you have. lsb-release is usually Ubuntu, while fedora-release, redhat-release indicate Fedora, RedHat, or CentOS. You can find a more complete listing here.
Alternatively, you can see if rpm or dpkg are installed by trying to run those commands:
rpm --version
dpkg --version
If dpkg is installed, it's probably Ubuntu/Debian based. If rpm is installed, it's probably RedHat/CentOS or openSUSE based.

Resources