Hot answers tagged

32

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 ...


22

Try installing them all together: sudo apt-get install nodejs npm node-semver


14

Getting Node.js on a Raspberry Pi You can either: Compile Node.js yourself (as ppumkin already pointed out)—takes about 2 hours on a Raspberry Pi. Or you can download the binary v0.8.17 Performance I did a quick performance test (to give a rough first impression): My Raspberry Pi is overclocked (Turbo) with default memory_split (64) Tests were ...


11

Github user Geoff Flarity has created a raspberry pi specific patch that allows node.js to be compiled for the raspberry pi. On top of this he includes pre-built binaries for the latest version of node and clear instructions. You can find this all here https://github.com/gflarity/node_pi


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

Unless you have a need for many concurrent users or processes writing to the database at the same time I would recommend sqlite. It is file based so you don't need a server running, and each project can use its own database file (unless they need to share data). If you use a database abstraction layer you can move to mysql or postgres without too much ...


9

Web Servers Node.JS can be used as a web server replacement on the Pi and you can create stand alone or Single Page web applications with ease. But just for your information, in most real world applications it is recommended to use servers like the modern nginx , light weight lighttpd or the chunky but fully featured apache2! And then script node.js to ...


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

If you can program, you can pick up python amazingly quick and get useful stuff done almost right away. There is an impressive library of stuff available as well. But it shouldn't be absolutely required for any pi related work. You can attach many sorts of IR receivers to a PI, from demodulating detectors (like used with TV remotes) on GPIO to somewhat ...


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

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/


5

I have not used it on the pi, but there's a node binary in the raspbian repository: » apt-cache show nodejs Package: nodejs Version: 0.6.19~dfsg1-6 Architecture: armhf Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org> You should be able to install this very easily with apt-get install nodejs. The version 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

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.


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

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

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

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 ...


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 ...


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.


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