Installing nodeJs in ubuntu - node.js

Hi I am trying to install nodejs in ubuntu 14 but getting following error.
E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 62%E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 100%
dpkg: cannot scan updates directory `/var/lib/dpkg/updates/': No such file or directory
E: Sub-process /usr/bin/dpkg returned an error code (2)
when trying to installing with software updated I am getting following error.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/aptdaemon/worker.py", line 300, in _process_transaction
not self.is_dpkg_journal_clean()):
File "/usr/lib/python3/dist-packages/aptdaemon/worker.py", line 1111, in is_dpkg_journal_clean
for dentry in os.listdir(status_updates):
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/dpkg/updates/'

I had this problem previously, I removed any variables equivalent to zero and it solved it, perhaps try that.

Add the Node.js-maintained repositories to your Ubuntu package source list with this command:
curl -sL https://deb.nodesource.com/setup | sudo bash -
Then install Node.js with apt-get:
sudo apt-get install nodejs
Optionally we can create a symbolic link for node (for reasons mentioned earlier):
sudo ln -s /usr/bin/nodejs /usr/bin/node
Using this install option, we end up with newer versions of Node.js and npm:
$ node -v
$ npm -v
to check node version and npm version

I suggest installing nvm (node version manager)
https://github.com/creationix/nvm
it allows you to install and use ANY node version, and this may be way better, because ubuntu is bound to one specific version. In web development, every project is prepared using dofferen node, so switching it might be necessary

Related

python3: can't install psycopg2 [duplicate]

I cannot figure this out for the life of me.
When I pip install django-tenant-schemas it tries to install the dependency psycopg2 which requires the Python headers and gcc. I have all this installed and still keep getting this error!
./psycopg/psycopg.h:35:10: fatal error: libpq-fe.h: No such file or directory
So to install libpq-fe-h I need to sudo apt-get install libpq-dev..
..which returns..
libpq-dev is already the newest version (10.10-0ubuntu0.18.04.1).
Then when I sudo find / libpq-fe.h it doesn't seem to be in my OS.
I am lost at this point. If anyone can help I would highly appreciate it.
For some reason, the file is missing on the system.
As you're using apt-get, the system is dpkg based, presumably Debian or it's derivative. You can try the Ubuntu's package search to get which package contains a file with name ending in libpq-fe.h.
I found the package is libpq-dev and file's absolute path is /usr/include/postgresql/libpq-fe.h.
FWIW, on a dpkg based system, you can check which package gives a file if you know the file's absolute path:
% dpkg -S /usr/include/postgresql/libpq-fe.h
libpq-dev: /usr/include/postgresql/libpq-fe.h
Also, unlike find, locate keeps a cache of found files (mlocate.db) that is created everyday via cron; so if the file happens to be removed after the last run, you can run locate libfq-fe.h to get the absolute path to the file without needing to check the Ubuntu package search online.
So the package is libpq-dev. Now, reinstalling it will get everything to the default state i.e. all relevant files will be copied to the right places. As it is only a library package, no user/system level configurations will be overridden (and dpkg will prompt you for action for any package that does that).
To reinstall the package:
sudo apt-get install --reinstall libpq-dev
For me, I realized it was trying to use the deprecated setup.py so I installed wheel (pip install wheel) and that sorted it all out.
Well after installing these libraries
sudo dnf install python-virtualenv openssl-devel gcc libffi-devel libxslt-devel issue was not gone.
I used mlocate to find where libpq-fe.h file is located. On my system (Fedora 32) it was located at /usr/pgsql-10/include/libpq-fe.h
yum install mlocate
sudo updateb
locate libpq-fe.h
After all added this line to ~/.bash_profile
nano ~/.bash_profile
export PATH=/usr/pgsql-10/bin/:$PATH
Works fine, I can easily install psycopg2 without any trouble.
You need to create a LD_LIBRARY_PATH that indicates the path of your library /user/pgsql-11/lib
Source: The 3rd point of build prerequisites at https://www.psycopg.org/docs/install.html#build-prerequisites

node installation failed on ubuntu 18.04

can anyone please help me with this issue? I had node installed then I uninstalled and rm -rf the file as well following some online suggestions. Then now I am trying to install it like i had done before using nvm install node
but now i am getting the following error:
Downloading and installing node v15.2.1...
Local cache found: ${NVM_DIR}/.cache/bin/node-v15.2.1-linux-x64/node-v15.2.1-linux-x64.tar.xz
Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/bin/node-v15.2.1-linux-x64/node-v15.2.1-linux-x64.tar.xz
mv: cannot move '/home/jan/.nvm/.cache/bin/node-v15.2.1-linux-x64/files/bin' to '/home/jan/.nvm/versions/node/v15.2.1/bin': Directory not empty
mv: cannot move '/home/jan/.nvm/.cache/bin/node-v15.2.1-linux-x64/files/include' to '/home/jan/.nvm/versions/node/v15.2.1/include': Directory not empty
mv: cannot move '/home/jan/.nvm/.cache/bin/node-v15.2.1-linux-x64/files/lib' to '/home/jan/.nvm/versions/node/v15.2.1/lib': Directory not empty
mv: cannot move '/home/jan/.nvm/.cache/bin/node-v15.2.1-linux-x64/files/share' to '/home/jan/.nvm/versions/node/v15.2.1/share': Directory not empty
Binary download failed, trying source.
Local cache found: ${NVM_DIR}/.cache/src/node-v15.2.1/node-v15.2.1.tar.xz
Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/src/node-v15.2.1/node-v15.2.1.tar.xz
$>./configure --prefix=/home/jan/.nvm/versions/node/v15.2.1 <
Traceback (most recent call last):
File "./configure", line 20, in <module>
from distutils.spawn import find_executable
ModuleNotFoundError: No module named 'distutils.spawn'
nvm: install v15.2.1 failed!
Thanks
To get this version, you can use the apt package manager. Refresh your local package index by typing:
sudo apt-get update
Install Node.js from the repositories:
sudo apt-get install nodejs
To check which version of Node.js you have installed after these initial steps, type:
nodejs -v
You just need to uninstall that version of node via nvm before reinstalling it.
nvm uninstall 15.2.1
nvm install 15.2.1

package python to be installed to custom location

My objective is to build a python rpm that can install to custom location on rhel 6 box.
I have take source from https://dl.iuscommunity.org/pub/ius/stable/Redhat/6/SRPMS/python34u-3.4.3-2.ius.el6.src.rpm
rpmbuild with prefix of /tmp/python/new_install succeeded in packaging.
When I try to install rpm, I am encountering circular dependency.
Install of ABCpython34u-3.4.3-2.ius.el6.x86_64.rpm gives
error: Failed dependencies:
ABCpython34u-libs(x86-64) = 3.4.3-2.ius.el6 is needed by ABCpython34u-3.4.3-2.ius.el6.x86_64
libpython3.4m.so.1.0()(64bit) is needed by ABCpython34u-3.4.3-2.ius.el6.x86_64
Install of ABCpython34u-libs-3.4.3-2.ius.el6.x86_64.rpm gives
error: Failed dependencies:
/tmp/python/new_install/bin/python3.4 is needed by ABCpython34u-libs-3.4.3-2.ius.el6.x86_64
Any guidance is much appreciated.
Update:
/bin/rpm -i --noscripts -v ABCpython34u-libs-3.4.3-2.ius.el6.x86_64.rpm ABCpython34u-3.4.3-2.ius.el6.x86_64.rpm 2>&1
error: Failed dependencies:
libpython3.4m.so.1.0()(64bit) is needed by ABCpython34u-3.4.3-2.ius.el6.x86_64
$ rpm -q --provides -p ABCpython34u-libs-3.4.3-2.ius.el6.x86_64.rpm|grep libpython3.4m.so.1.0
libpython3.4m.so.1.0()(64bit)(ABC)
You just need to install them together:
yum install ./ABCpython34u-3.4.3-2.ius.el6.x86_64.rpm ./ABCpython34u-libs-3.4.3-2.ius.el6.x86_64.rpm
But what you are doing (python in custom location) is very likely wrong. If you want to have recent python on RHEL6 box you very likely want Software Collection:
https://www.softwarecollections.org/en/
https://www.softwarecollections.org/en/scls/rhscl/rh-python34/

Error installing Nodejs on CentOS 5 server - no module bz2

I'm trying to get NodeJS installed on my CentOS 5 server
I got Python 2.6 installed, and I got ./configure to work, but when I run the make command I get this result
[root#catch24dev node-v0.8.6]# make
make -C out BUILDTYPE=Release V=1
....
Traceback (most recent call last):
File "../../tools/js2c.py", line 36, in <module>
import bz2
ImportError: No module named bz2
make[1]: *** [/usr/local/src/node-v0.8.6/out/Release/obj/gen/libraries.cc] Error 1
make[1]: Leaving directory `/usr/local/src/node-v0.8.6/out'
make: *** [node] Error 2
[root#catch24dev node-v0.8.6]# which bzip2
/usr/local/bin/bzip2
I, too, got the same error as Marius Milliunas when I ran make on Centos 6.4 - That was after I ran the ./configure command in the nodejs directory, which I had extracted from the downloaded nodejs tarball. Just as Marius Milliunas did.
The root of the problem is that the nodejs installation relies on Python being installed. Specifically, the default Python installation for Centos 6.4 does NOT include the bz2 module and corrective action, of course, starts with installing the bz2 module. This is done by running
yum install bzip2-devel
I also ran for good measure
yum install bzip2
The built-in Python for Centos 6.4 is Python 2.6.6 but that's fine for the purpose of installing the latest version of nodejs, which as of this writing is node v0.10.26
Once you have run yum install bzip2-devel , you can go back and run make in the nodejs directory and this time, make will run to completion. Follow up by running make install as per the instructions set in the nodejs directory.
You can test your nodejs installation by running node and getting the prompt. I chose to test by creatind a nodejs-based web server, as described in http://code.tutsplus.com/tutorials/real-time-chat-with-nodejs-socketio-and-expressjs--net-31708
I knew all was cool with the world and that I had properly installed nodejs on Centos 6.4 when I followed this instruction
The server is running, so you should be able to open http://127.0.0.1:3700/ and see:
It works!
and got the "It works" output, as expected :)
Important Note
If you are additionally installing Python 2.7.6 and Python 3.3.4 on the Centos 6.4 machine, follow the instructions on this link: https://www.digitalocean.com/community/articles/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4
Installing Python 2.7.6 and Python 3.3is purely optional. Note that the last step of installing Python 2.7.6 and Python 3.3.4 is
make altinstall
and NOT "make install" I ran "make install" by mistake and destroyed my access to system Python, which is Python 2.6.6, and my access to yum. In fact, I surmise that I destroyed my access to every program on Centos 6.4 that relies on access to system Python to work properly. If I had successfully installed nodejs by that point in time, I would have destroyed my access to nodejs, too. I had to destroy and recreate /usr/local/bin/python2 as the soft link to /usr/local/bin/python2.6 and do the same with /usr/bin/python2 to get things back to normal. Not much fun.
Note that another solution to this issue (unable to compile node.js) is to use the binary distributions for Linux which have been published since 0.8.6
Here's the script I used:
# get the latest stable binary
# (modify version number based on what you find in that folder)
wget http://nodejs.org/dist/latest/node-v0.8.20-linux-x64.tar.gz
cd /usr/local/
sudo tar xzvf ~/node-v0.8.20-linux-x64.tar.gz --strip=1

Apache2::Request (libapreq2-2.13) on centos 5.5

I'm having a torrid time installing Apache2::Request on Centos 5.5. My apache is the standard one that came with centos.
I'm installing from libapreq2-2.13 and a lot of dependencies didn't already exist. I so far had to do:
yum install httpd-devel # for apxs
I then did:
perl Makefile.PL --with-apache2-apxs=/usr/sbin/apxs
make
The make step then told me i needed: ExtUtils-XSBuilder and Parse-RecDescent, which i duly installed.
running make again gave the compiler error:
/home/xx/installers/libapreq2-2.13/glue/perl/xsbuilder/apreq_xs_postperl.h:22:34: error: modperl_perl_unembed.h: No such file or directory
/home/xx/installers/libapreq2-2.13/glue/perl/xsbuilder/apreq_xs_postperl.h:25:33: error: modperl_common_util.h: No such file or directory
In file included from Apache2.xs:45:
/home/xx/installers/libapreq2-2.13/glue/perl/xsbuilder/APR/Request/Apache2/APR__Request__Apache2.h:1:22: error: mod_perl.h: No such file or directory
Can anyone tell me which package i'm missing?
Is there not a method of installing this common package that "just works" (tm).
Many thanks
It's already packaged for Centos.
$ repoquery -i --whatprovides 'perl(Apache2::Request)'
perl-libapreq2-0:2.09-0.rc2.1.el5.x86_64
$ sudo yum install perl-libapreq2
(Actually, that only works if you're using the EPEL repository)
To install the headers , yum install mod_perl-devel

Resources