Hot answers tagged

33

This is the best way to install NodeJs on raspberry pi, i love that way, and i think it's easy to to do, and later for update just replace the '/opt/nodejs' folder with the new release: wget https://nodejs.org/dist/v4.2.4/node-v4.2.4-linux-armv6l.tar.gz sudo mv node-v4.2.4-linux-armv6l.tar.gz /opt cd /opt sudo tar -xzf node-v4.2.4-linux-armv6l.tar.gz ...


29

The reason why this is not working on your Raspberry Pi 1 is, that these packages are compiled for the wrong CPU - armhf (ARM 32-bit hard-float, ARMv7 and up: arm-linux-gnueabihf) So the package should work on your Pi2 but not on the Pi1. I guess there is no quick and easy way to get an image that runs on both. If you want to install a modern nodejs on your ...


11

I installed node.js using the second method in the question today, worked just fine. I have Raspbian Jessie on a Raspberry 3. curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs sudo apt-get install -y build-essential I don't know why that method didn't work for you. Perhaps it's been updated and works better now?


9

This is still an unresolved issue with the newest version of Node (as of this writing, v0.12.2) When browsing Node distributions, the latest ARM build is in v0.11.9, meaning you will currently need to compile from the source, if you want Node.js v0.12. The following is only related to compiling from source in Raspbian. Reason for 'Illegal instruction' ...


8

I have seen this before on the Pi, where packages that are compiled by gyp refuse to compile or install. One method of getting around this problem is to install a precompiled binary. To do this start by making sure that your Pi is up to date by entering the following in the terminal: sudo apt-get update && sudo apt-get upgrade next download node (...


7

To check for Raspbian read the file /etc/os-release and check for ID=raspbian. PRETTY_NAME="Raspbian GNU/Linux jessie/sid" NAME="Raspbian GNU/Linux" ID=raspbian ID_LIKE=debian ANSI_COLOR="1;31" HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" To check for a Pi ...


7

For example to install RPi nodejs version 4.3.1 (see below for other versions) wget https://nodejs.org/dist/v4.3.1/node-v4.3.1-linux-armv6l.tar.xz tar xf node-v4.3.1-linux-armv6l.tar.xz cd node-v4.3.1-linux-armv6l/ sudo cp -R * /usr/local Check installation with node -v Different versions are available from https://nodejs.org/dist/ For the Pi2B make ...


6

Based on joan's answer I've created a tiny Node.js library. It can be used to check if node is currently running on the RPi. You can install it through: npm install detect-rpi --save To use it, you can use the following snippet: var isPi = require('detect-rpi'); if (isPi()) { console.log('Running on Raspberry Pi!'); } else { // ... }


6

You should install libasound2 first: sudo apt-get install libasound2-dev


6

In one line of code, latest version, for any raspberry pi: wget -O - https://raw.githubusercontent.com/audstanley/NodeJs-Raspberry-Pi/master/Install-Node.sh | sudo bash; node -v; Source code: https://github.com/audstanley/NodeJs-Raspberry-Pi/


6

To be able to connect to 127.0.0.1 (in other words the loopback IP) does not mean that the server app is bound to all network interfaces of the system. To listen all existing or will be existed interfaces, an app should be bound to the address 0.0.0.0. By this way, remote clients will be able to connect to the corresponding IP adresses.


5

A good way is to take a minimal image and bolt on the things you need your self. This 118mb minimal image is hard float compiled so some computational methods should be allot faster and only takes up 14mb of ram after booted. It has a NTP server to stay in synch with time. Read the website on how to configure first boot as none of the extra heavy stuff is ...


5

I definitely think this has to do with your PATH. An easy way to check this is to compare the output of echo $PATH with the output of sudo echo $PATH. If the node.js directory is present in the first but not in the second, there is something going on with your PATH setup. The reason for this is that sudo does not actually load the root profile. Rather, it ...


5

As of about April last year, it seems, NodeJS support for Armv6 moved to experimental see this thread for the RFC / discussion / reasoning etc. Armv6 is still supported and maintained on an experimental basis with all the caveats that word entails. The project is hosted at github and the binaries can be downloaded from here downloads. The site is a basic ...


4

Adafruit provides a (relatively) current node and npm. After not finding a compile helpful this worked for me with a number of packages (express, body-parser, pg)


4

The only real answer to this question is "it depends". I'll do my best to outline what it depends on, and which platform is suited to which cases. But first, a couple of clarifications. Node.js describes itself as "a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications" [1]. JavaScript is also the programming ...


4

With a great help from the viable example, I've been luckily able to solve the problem: since fibers is a compiled dependency I leveraged on synchronize dependency version update, hoping that the problem was been solved. Making the "micro" update of synchronize, from 0.5.1 to 0.5.4, its fibers made a big jump, from 0.6.x to 1.0.x: it seems that the problem ...


4

There likely is no problem, this is probably what you're paying for. I have a colocated pi serving webpages. As this is hosted in a data center with proper network I don't have this issue. If you're hosting something via your ISP and not a hosting/colo copmany you're not being realistic in your comparisons. Just because the NIC on the pi is 100Mbps does ...


4

Eventually, it might be easier to get rid of your current installation based on your linked guide and try to follow the very simple steps offered by Adafruit. https://learn.adafruit.com/node-embedded-development/installing-node-dot-js Works very nicely and you'll get the latest node.js (v0.10.35) installed. Regards, JoKi


4

I suggest using this module to switch and read GPIO pins, it is easy to handle and works very well: https://www.npmjs.com/package/onoff Another module: https://www.npmjs.com/package/rpio


4

Eventually I've used a compiled version (node.js v12.02) by Conor O'Neill that applied a patch: http://conoroneill.net/download-compiled-version-of-nodejs-0121-stable-for-raspberry-pi-here The steps I've made: wget http://conoroneill.net.s3.amazonaws.com/wp-content/uploads/2015/04/node-v0.12.2-linux-arm-pi.tar.gz tar -zxvf node-v0.12.2-linux-arm-pi.tar.gz ...


4

I'm port forwarding on my Raspberry Pi by adding these lines right before the exit line in /etc/rc.local: # Forward port 80 to 5000 (where our web server is) so the # web server can run at normal permissions iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 5000 This allows me to request on port 80, but have the web server running at ...


4

How to install wget https://nodejs.org/dist/v5.0.0/node-v5.0.0-linux-armv7l.tar.gz tar -xvf node-v5.0.0-linux-armv7l.tar.gz cd node-v5.0.0-linux-armv7l sudo cp -R * /usr/local/ #attention copies also readme and other not required files Why ArmV7: On my pi & package is written Raspberry Pi 3 Model B and according to wikipedia: The ARM Cortex-A53 is a ...


4

I found the solution after all. I used pm2 after all. The quick start suggested at the start of the pm2 documentation will not work. Follow the detailed instructions instead, which amount to: Install pm2 for node (npm install -g pm2) Type “pm2 startup” into the command line Paste in the resulting command as instructed. Change directories to where your app ...


4

You can setup an access point on the RasPi so the smartphone can connect to it. There are hundreds of tutorials about this on the web, but many of them are outdated. The official Raspberry Pi web site for this you can find at Setting up a Raspberry Pi as a routed wireless access point or at Setting up a Raspberry Pi as a bridged wireless access point but ...


4

Packaged on debian based distribution: sudo apt install tldr With npm: Install a supported nodejs version: curl -sL https://deb.nodesource.com/setup_current.x | sudo bash - sudo apt install nodejs Then run: sudo npm install npm@latest -g sudo npm install tldr -g npm WARN npm npm does not support Node.js v10.23.1 npm WARN npm You should probably upgrade to ...


3

If your main focus is to enhance performance you can lower the allocated GPU memory, since you wont be doing graphical tasks. To achieve this you must define the RAM available to 16MB by editing /boot/config.txt, and adding: gpu_mem=16 This ain't the only possibility, but is a good one to start with.


3

your browser is requesting your scripts while reading main .html file, hence the other 4 new processes (note, request to fonts.google.com does not result in the new process started). it's a typical behaviour, you should not be worried about that.


3

I find the easiest way to get NPM (and the latest version of Node.js) on any Raspberry PI (Zero to 3) is to use "NVM" (Node Version Manager). To install NVM: wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.6/install.sh | bash export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm Once ...


3

When the latest package raspberrypi-bootloader:armhf 1.20150130-1 was installed, the gpio symbolic links in /sys/class/gpio/ moved from /sys/devices/virtual/ to /sys/devices/soc/20200000.gpio. Solution 1 chmod -R +x /sys/devices/soc/20200000.gpio Solution 2 Update the pi-gpio.js so that sysFsPath = "/sys/devices/virtual/gpio"; points to the new path: ...


Only top voted, non community-wiki answers of a minimum length are eligible