./configure not present in node.js tar - node.js

I'm following a Node.js tutorial for compiling Node from Source with NPM. The issue is that while previous builds contain the configure script, the most recent tar, 6.9.2, does not but that's a part of the steps required for compiling from source. If I download an older version like 0.1.5, the configure script is there. The tutorial requests I do a ./configure but there's nothing resembling configure after I unzip 6.9.2. Here's the tutorial I'm following: https://www.digitalocean.com/community/tutorials/how-to-compile-node-js-with-npm-from-source-on-centos-6
What am I doing wrong?

If you have downloaded the source from
https://nodejs.org/dist/v6.9.2/node-v6.9.2.tar.gz the configure script should be there.
Also, see the github page for node.js:
https://github.com/nodejs/node
where configure script is present.
I guess you downloaded it from elsewhere? Nevertheless, here is the standard build procedure for Node:
https://github.com/nodejs/node/blob/master/BUILDING.md
Hope this helps.

If you have CentOS 6.x, and have enabled the EPEL repository, you can use yum to install node/npm:
$ sudo yum install npm

Related

LESS instalation - node file does not exist on Linux

I'm trying to install LESS css in Netbeans, but I'm running into one problem after another. As such, I already have LESS installed, but I can't get it running.
Less is installed via the npm package, I installed it using the packaging system, less itself via Terminal. The first problem I had was that despite a successful installation, Netbeans didn't get to the files he needed (usr/local/), I could either change permissions there, which I don't want to dig into, or change the location. So I changed the location of the .npm and .npm-global folders to my root (home/ivet/), from where Netbeans managed to load it.
So I set everything there, the general settings and the specific project and it looked fine.
I want it to be converted to css automatically after saving, but it throws the message "/usr/bin/env:"node": Directory or file does not exist" and the target css file is still empty.
I found a few advices, basically the same: "ln -s /usr/bin/node/ usr/local/bin/nodejs", but it tells me that the link already exists and nothing will solve it. On closer inspection, I found that the link does exist, but the target file does not exist.
I've also found that installing Nodejs legacy solves this, but this is an older piece of advice, the package no longer exists, and terminal pretends to have the packages that replace this installed. Even when searching for via grep, I couldn't find the file it should link to (neither node nor nodejs).
There are the same tips everywhere that don't work for me and I don't know what to try next. I use Linux Mint 20, but I call myself a Linux BFU, so please write answer step by step :-D
Thanks for the advice
Try completely removing NodeJS & npm and try to install NodeJS using nvm i.e., node version manager.
You can follow this link on how to install nodejs and npm using nvm.
It's always a tedious task sometimes when it comes to package managment with npm, so it's better to go with nvm and I strongly suggest to always have a fallback option for node version when using with or without nvm i.e.,
NodeJS LTS version & NodeJS latest/stable version.
There's also an alternative solution i.e.,you can try switching to yarn package manager.
I've had this issue on Ubuntu and I've resolved it likes this:
First of all I've removed node and npm packages via
sudo aptitude remove node npm
Then I've added the official repositories
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
After which I've just updated the list of packages with sudo aptitude update and then installed Node
sudo aptitude install nodejs npm
And that was it. With these steps done, everything just started to work.

Where to put this Nodejs package

I just started on nodejs and downloaded the LTS binary from
https://nodejs.org/en/
However, I can run the executable in the bin folder by ./node I don't know where to put all these files to let them function as a normal apt-get package. There are sitting in my download folder for now.
The sudo apt-get install nodejs gives me a older version of node like v 4.2.6
I did search official installation guide and all that. All it says is download the LTS binary.
bobby#bobby-Lenovo-Y430P:~/Downloads/node-v6.9.4-linux-x64/lib$ cd ..
bin CHANGELOG.md include lib LICENSE npm-debug.log README.md share
You have many options where to put them. It's easiest to put it in /usr/local because /usr/local/bin is likely in your PATH. But there are other options.
For more info see my tutorial.

Running node.js server on Ubuntu using forever

I'm trying to use the 'forever' node.js package to run a node.js service on Ubuntu. Seems like it should be straightforward. However, when I run it, I receive the following output:
/usr/bin/env: node: No such file or directory
I think this may be because the Ubuntu package manager names the node.js binary nodejs, rather than node, which is more standard. Is there a way to tell the forever package where to find node?
(I did try symlinking /usr/bin/node to /usr/bin/nodejs, but that produced even more errors and it feels like a hack anyway)
Have you tried installing the latest node from source?
git clone https://github.com/joyent/node.git
cd node
git checkout v0.8.22 #Try checking nodejs.org for what the stable version is
./configure
make
sudo make install
This video isn't entirely clear, but the author implies that older versions of node in the Debian repository are behind the node/nodejs naming issue.
Alternatively, you could try finding the target of the /usr/bin/nodejs symlink using any of the methods described here and create a /usr/bin/node symlink to that.
Good luck!

Should I install node.js on Ubuntu using package manager or from source?

Does anyone know if installing the latest build from source is a risky route to take? Should i just stick with the package manager?
Current recommendations
Use install-node-on-linux if you want a really simple install with your user account (disclaimer: I'm the author).
Use nvm if you want to install with your user account + you need to regularly switch between versions, and you're cool with a little bit of tool and environment complexity.
Follow the directions here to install via the NodeSource PPA. This is easy to do but it's the least flexible.
Old Answer
Note: At the time of this writing I'm using Ubuntu 12.10.
There are a lot of ways to install node. I personally prefer to download the source of the latest stable build and just install it to ~/local (you do this by adding --prefix to the ./configure command as seen here. There really isn't any 'risk' in doing this as everything gets installed in a directory which is separated from the rest of your system. You can have a look at the node recipe in my system install scripts here. I regularly run my update_node.py script to upgrade my installation to the latest version.
Alternatively you can follow the directions here to install the latest stable version via the package manager. I haven't actually done that so I can't comment on how well it works.
What I wouldn't do is install node from the ubuntu universe packages. You'll end up with a very dated version (currently 0.6.19).
update 1/26/2013:
If you are interested in installing node with your user (non-root) account, I highly recommend reading this blog post. I skipped the ~/.npmrc step, but found that the ~/.node_modules symlink step was critial for getting require to work properly.
update 12/30/2014:
I have migrated to using linux mint and doing binary node installs. If you have any interest in writing your own installation scripts, you can find my current one here. Specifically have a look at what I'm doing in node.sh. The execute function is run during the first install so it does things like configure the paths in .bashrc. The install function is run by update-node.sh and is used to remove an existing installation and add a new one (the latest version or one specified by the user).
update 1/8/2016:
I just switched over to using nvm. Simply install the script and then run nvm install node to get the latest version. This seems like an excellent way to get node installed with your user account.
another option is nvm (Node Version Manager) : https://github.com/creationix/nvm
bonus that it lets you easily switch between versions.
Although I live in an .rpm, and not .deb realm, fpm can do both (needs Ruby installed). I have been able to package node.js from the latest stable source without any major difficulties. In your case, the following scenario may help:
./configure --prefix=/usr
make
mkdir -p /tmp/nodejs
make install DESTDIR=/tmp/nodejs
fpm -s dir -t deb -n nodejs -v 0.8.15 -p nodejs-0.8.15.deb -C /tmp/nodejs usr

Problem installing socket.io on Fedora Core

I'm trying to install socket.io on my machine, but I keep encountering errors when I run npm install socket.io as directed on their website. I'm not sure if I have version incompatibilities for npm or node.js or if I'm simply missing something obvious. As far as I can tell, I have the most recent stable version of both of them.
When I run the install command, the console outputs 40+ errors, and at the end I am given the line npm not ok. Any ideas as to what is going wrong?
What is the error?
Are you installing npm using code from git? I can only guess that you are not using a stable code, because the master branch from git is often unstable.
If that is the case, what you can do is to get the latest code from the git repository and install it again.
$ cd npm
$ git pull
$ make install
Hope it will solved your problem.
You need to provide an error log if you want anyone to try and troubleshoot your problem. It would also be helpful to know whether you installed Node and NPM from source or RPM. Furthermore, if you installed from source, did you do a standard install or did you make customisations?
If you are able to start from scratch, I suggest following the steps below and seeing how you go. Installing into your home directory won't require root and it makes it easier to clear everything out if you need to start again.
Install the stable release of Node in your home directory (use ./configure --prefix=~/Node/)
Set your path as appropriate (ie. PATH=/home/user/Node/bin:$PATH)
Run the standard NPM installer (curl http://npmjs.org/install.sh | sh)

Resources