NodeJS on Windows 10 and Windows Subsystem for Linux - node.js

I'm trying to get Expo, a platform for making native mobile apps, to run on a Windows 10 machine. A preprequisite for Expo is NodeJS so I installed that. However, I ran into some issues getting Expo to work using Git Bash and so now I'm trying to get Windows Subsystem for Linux (WSL) operational to use that instead. Ubuntu 18.04 LTS has been downloaded and initialized. Using a CMD here is what's happening:
C:\Users\jason.black>node -v
v12.13.0
C:\Users\jason.black>wsl
jason#PC1:/mnt/c/Users/jason.black$ node -v
Command 'node' not found, but can be installed with:
sudo apt install nodejs
jason#PC1:/mnt/c/Users/jason.black$ sudo apt install nodejs
[sudo] password for jason:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nodejs
jason#PC1:/mnt/c/Users/jason.black$
So it appears that NodeJS which was initially installed is not available to WSL. Does that seem right? And why won't it install so WSL can access it?

If you're trying to access Node installed on the windows site, you may specify the PATH to /mnt/x/.../path/to/node/bin; if you're trying to install nodejs on the Linux side, may be you're looking for the package 'node' (not nodejs), or you can just download the portable version: https://nodejs.org/dist/v12.13.1/node-v12.13.1-linux-x64.tar.xz
For someone who's not familiar to Linux:
# will be download to home directory
cd ~
# using wget
wget https://nodejs.org/dist/v12.13.1/node-v12.13.1-linux-x64.tar.xz
# using curl
curl -o node-v12.13.1-linux-x64.tar.xz https://nodejs.org/dist/v12.13.1/node-v12.13.1-linux-x64.tar.xz
# extract
tar xf node-v12.13.1-linux-x64.tar.xz

Related

Installing node 16 in Ubuntu 20.04 (WSL) gives me node 14

I installed node 16, on Ubuntu 20.04 (WSL on Windows10) using these commands:
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
And it gets the right package
Unpacking nodejs (16.13.1-deb-1nodesource1) ...
Setting up nodejs (16.13.1-deb-1nodesource1) ...
But somehow, I get node 14
$ node -v
v14.15.5
I had nodejs installed already before I tried to upgrade to 16 but I am pretty sure the installer removed it.
I tried to remove the package nodejs and installagain , I ran apt autoremove, I checked /etc/apt/sources.list.d/nodesource.list and there is only the node_16.x PPA...
What did I miss? Where is that node 14 coming from?
My bad... Turns out it was emscripten who had installed another NodeJS in its own app folder and was setting that in the env.
I just deleted the node directory in the emsdk folder and it's working.
Edit: I had compilation issues on MacOS when I removed the node directory because emscripten was using system libs that were probably not matching its expectations. So I had to restore it (using emsdk install SOME_VERSION).

How to install nodejs version 6 in Linux Mint 18.3 sylvia

I need to install Nodejs version 6 in Linux Mint 18.3 sylvia.
I already tried running this:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
But result in errors like:
E: Failed to fetch cdrom://Linux Mint 18.3 _Sylvia_ - Release amd64
20171124/dists/xenial/contrib/binary-i386/Packages Please use apt-
cdrom to make this CD-ROM recognized by APT. apt-get update cannot be
used to add new CD-ROMs
E: Failed to fetch http://ppa.launchpad.net/rabbitvcs/ppa/ubuntu/dists/**DISTRIBUTION**/main/
binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Error executing command, exiting
Anyone have Idea to install this? Thanks
Installing Node.js is pretty straightforward using Linuxbrew, the Linux port of Homebrew. It handles downloading, unpacking, compiling, and installing Node on your system. After you have Linuxbrew installed, the whole process should only take you a few minutes.
Open up your terminal and type brew install node.
Sit back and wait. Homebrew has to download some files, compile and install them. But that’s it.
try to install the current version
10.15.3 LTS

Error installing nodejs in arch linux

Okay so i just made a fresh install of nodejs package on archlinux using pacman. Command for the same was
sudo pacman -S nodejs npm . Now when i tried to run the same i am getting error as
node: error while loading shared libraries: libicui18n.so.57: Which pretty much means that libicu is either not there or not the correct version. The problem that i am facing is that it is not there in pacman. I tried
sudo pacman -S libicu, which returned not able to find the package. What is the right way to resolve this issue. FYI : just a note, i would prefer not to install from source and prefer using pacman for the same. If there is any other output that you need to know please comment below and will let you know about the same.
I am currently on manjaro i3 fresh install.
Just found out, The name for package in arch linux is icu and not libicu. Once that is installed node will start working fine.
Update
After using node for quite sometime i realised that a better way to install node is using NVM. It would install both node and npm locally and you get the option to manage multiple version.Installation is as simple as
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
This error is caused by installing node js and npm package modules with missing packages that are unsupported by your system how about you try this:
$ sudo pacman -Rsc -n nodejs
$ sudo pacman -Sy nodejs
$ sudo pacman -Sy npm
did you use testing repo?
If you enabled testing repositories, but later on decided to disable them, you should:
Remove/Comment them from /etc/pacman.conf
pacman -Syuu to "rollback" your updates from these repositories.
The second item is optional, but keep it in mind if you notice any problems.
Also you can install stable ver : pacman -S core/icu
You just need to update arch
sudo pacman -Syu

When I run node, nothing happens, the same with forever

I installed both node.js and forever.js and when I run them in my terminal (bash on Ubuntu 14.04), nothing happens.
So, it looks like:
#node
#
or
#forever
#forever --help
#forever listall
#
Everything else not node-related runs fine.
There was something wrong with apt-get, so when installing node, it didn't actually install node, but it did put a program in the path that did seemingly nothing.
I uninstalled it with
apt-get purge node
Then, I downloaded the 64-bit linux binary from here: http://nodejs.org/download/
And I extracted it with tar -xvf filename, then I set that directory/bin to the path with:
PATH=$PATH:/directory/to/node/bin
And now it works fine. The forever issue was because the node installed wasn't node at all, but instead a 30kb program of some sort, I don't know.
Here's the information about the program that was installed via apt-get install node:
Package: node
Priority: optional
Section: universe/hamradio
Installed-Size: 38
Maintainer: Ubuntu Developers <ubuntu-devel-discuss#lists.ubuntu.com>
Original-Maintainer: Debian Hamradio Maintainers <debian-hams#lists.debian.org>
Architecture: all
Version: 0.3.2-7.4
Depends: ax25-node
Conflicts: nodejs-legacy
Filename: pool/universe/n/node/node_0.3.2-7.4_all.deb
Size: 1284
MD5sum: 7385a0f5916e03d9143459ca4706f0ec
SHA1: bf7aa087db81475636897ff39de344754ce1415b
SHA256: 9756770f771bcc4183cffa622f89e21a585be96bd4de27024b0a7cb167f310ad
Description-en: Amateur Packet Radio Node program (transitional package)
The existing node package has been renamed to ax25-node. This transitional
package exists to ease the upgrade path for existing users.
Description-md5: 1278ed271672fd829c99361f93f468da
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
So, I also found that the correct way to install node with apt-get is apt-get install nodejs.
I had the same issue, and I think it was caused because I naively apt-get installed node first. Doing a
sudo apt-get purge node
Followed by the instructions on the web here (https://github.com/nodesource/distributions):
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs
fixed the issue for me. node doesn't exist, but nodejs does and other tools work (like slap) now.
EDIT: On one server I updated, node did exist. Not sure exactly what order things need to happen in, but whatever...
I was having this issue, I found that to solve the issue, I needed to remove the node file within /usr/sbin/node (found with which node) and replace it with a hard link to /usr/bin/nodejs (found with which nodejs)
ln /usr/bin/nodejs /usr/sbin/node
Just run nodejs command on your terminal after installing nodejs package.
It will give you the JavaScript prompt or interpreter.
The problem you are having is that apt-get installed NodeJS under the binary nodejs. Also when you do a npm install forever -g it also expects the binary to be node.
To verify this you can do a
% which forever
lrwxrwxrwx 1 root root 39 Jan 25 21:34 /usr/local/bin/forever -> ../lib/node_modules/forever/bin/forever
to find the location of the forever script.
Then check the node binary it's trying to execute.
% vim /usr/local/lib/node_modules/forever/bin/forever
#!/usr/bin/env node
This /usr/bin/env node needs to be changed to /usr/bin/env nodejs.
But to bypass this problem you should definitely look into using upstart.
http://howtonode.org/deploying-node-upstart-monit

Adobe Air native installer Linux - Dependency is not satisfiable

I created native installers for my air application successfully under MacOS and Windows.
With Ubuntu 10 I am able to create a .deb package, but when I launch it opens the Ubuntu software center showing error:
Dependency is not satisfiable: adobeair (>= 2.5.0.0)
I thought native installer should be able to download the proper adobe air version if available (2.5.1 seems available as deb package). If I install air for linux 2.5.1 from adobe website my application launches fine.
Did anyone experience the same issue?
Thanks in advance for any help
Paolo
Unfortunately, many years late "Adobe AIR for Linux is no longer supported." following what adobe page says. Using the "AIR archive" is possible to get unsupported versions, the 2.6.0 version is the most recent available. If you need to install a program that require a newer version of it, you might go to Virtual box with a Windows guest.
For version 2.6.0 the recommend steps for Ubuntu 16.10 are:
for 32bit machine
wget -O adobe-air_i386.deb http://drive.noobslab.com/data/apps/AdobeAir/adobeair_2.6.0.2_i386.deb
sudo dpkg -i adobe-air_i386.deb
sudo apt-get install -f && rm adobe-air_i386.deb
for 64bit machine
wget -O adobe-air_amd64.deb http://drive.noobslab.com/data/apps/AdobeAir/adobeair_2.6.0.2_amd64.deb
sudo dpkg -i adobe-air_amd64.deb
sudo apt-get install -f && rm adobe-air_amd64.deb
The recommend steps for Ubuntu 16.04/14.04/12.04/Linux Mint 18/17/13 (both extracted from here):
wget -O adobe-air.sh http://drive.noobslab.com/data/apps/AdobeAir/adobe-air.sh
chmod +x adobe-air.sh;sudo ./adobe-air.sh
What version of the adobeair package is available from the Ubuntu repositories?
A .deb is just an archive and the dependencies have to be available from the repositories the system is configured to use. It can't resolve the dependency by downloading it from some specific location you know of but the system is not configured to use.
If the needed version of the package is not available from the Ubuntu repositories then your only options are to reconfigure the system to use an additional repository that does have the needed dependency before you try to install your package, or download and manually install the dependency before you try to to install your package.
Try to install itdpkg -i --force-architecture adobeair.deb

Resources