![]() You can override this by setting the path explicitly, like this: sudo env "PATH=$PATH" npm -g i some_module This is because the default sudoers config uses a safe reset for the path. NOTE: if you install with this method, you may find that the node, npm, npx or any other binary commands installed via a global node module do not work correctly with sudo. This is the method I use on one of my older Pis, and I find that it makes upgrading fairly easy (though far more time-consuming that using nvm or apt). profile that can be used to switch the versions. You might prefer setting up Node this way, since it makes it slightly easier to install mutiple versions (as it puts each version of Node in a subdirectory of /usr/local/lib/nodejs and adds variables to. Another way to install the binaryĪn alternative method is described here. The downside of the above is that it doesn't put the /usr/local/node/bin directory on your path, so any binary commands that get installed when you do something like npm i -g cli-providing-package will require using the full path. ![]() ![]() Npm -v # Verifying that the npm install worked Node -v # Verifying that the Node.js install worked Sudo mv node-vX.X.X-linux-armv6l /usr/local/node The good news: you can still get up-to-date armv6 builds from the Unoffical Builds project, including the lastest v14.X LTS versions: See below for unofficial builds, which will keep your Node.js updated, patched, and supported, but avoids you having to build it yourself. At least that version will get support -including security updates- through April 2021. I recommend sticking with the v10.X/LTS Dubnium releases. The last version to get official builds for this platform was v11.x, which is now retired. ![]() Note: it looks like official builds for Node on Linux armv6 stopped with the v12.x releases. This method works for all Raspberry Pi models, as long as the official distribution keeps building for armv6. You can download and install binaries of Node.js from. Unfortunately, NodeSource only build for armv7/armv8, so this won't work for Raspberry Pis that use armv6, like Pi 1 and the Pi Zero/Zero W. ![]() This method lets you pick a modern version of Node.js, and still use apt, so you can get updates pretty easily. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |