Can't install nodejs-legacy - node.js

I'm trying to follow this tutorial and having issues with Node.js installation. Installing on a Debian VM, and have run the suggested installation command on the nodejs site:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejson
When I run sudo apt-get install nodejs-legacy It gives me this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nodejs-legacy : Depends: nodejs (>= 0.6.19~dfsg1-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Any ideas about what's going on?

Found this old .txt file with some instructions whilst sorting through junk. Looks like I ended up solving the problem.
sudo apt-get install python3-pip
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
sudo npm i webpack -g
sudo npm install --global yarn#1.0.2
https://cloud.google.com/community/tutorials/setting-up-postgres
sudo -u postgres psql -c 'create database saleor'
sudo -u postgres psql -c "CREATE ROLE saleor WITH SUPERUSER CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD 'saleor';"
sudo -u postgres psql -c 'grant all privileges on database saleor to saleor;'
sudo apt-get install python3-venv
pyvenv env1
source env1/bin/activate
deactivate
sudo apt-get install git
git clone https://github.com/mirumee/saleor.git
cd saleor
pip3 install -r requirements.txt
export SECRET_KEY='yourkey'
python3 manage.py migrate
yarn
sudo apt-get install libfontconfig
yarn run build-assets

Related

npm : Depends: node-gyp (>= 3.6.2~) but it is not going to be installed

I did the following steps:
git clone https://github.com/nibtehaz/NORTH-app.git
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install # which caused the following error
and got
The following packages have unmet dependencies:
nodejs : Conflicts: npm
npm : Depends: node-gyp (>= 3.6.2~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I did what was suggested, but it lead to another problem:
sudo apt install node-gyp
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
node-gyp : Depends: libnode-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages
What did I miss?
For Ubuntu 18.x and 20.04, here's what does it:
sudo apt remove --purge nodejs npm
sudo apt clean
sudo apt autoclean
sudo apt install -f
sudo apt autoremove
sudo apt install curl
cd ~
curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -
sudo apt-get install -y nodejs
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn
node -v && npm -v
If you face this issue in Ubuntu 20.04 do:
sudo apt install libssl1.1=1.1.1f-1ubuntu2
sudo apt install npm
Check this
I ran into the same thing, when I tried to install nodejs and npm in a buster-based docker container.
It seems that now, you need to install yarn which will take npm along.
The solution was apt-get install nodejs yarn.
Afterwards, the npm command worked.

How To Install Node Js In Ubuntu 18.10?

i'm trying to install nodejs in Ubuntu 18.10 but it returns some error.
The following packages have unmet dependencies:
nodejs : Depends: python-minimal but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Above is the message i get while install node Js by cammand: sudo apt-get install nodejs.
As described in this link:
Install node version manager:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
Activate nvm:
. ~/.nvm/nvm.sh
Use nvm to install the version of node you want:
nvm install 4.4.5
Test that Node.js is installed:
node -e "console.log('Running Node.js ' + process.version)"
The recommended way to install node under Ubuntu appears to be to use the archives provided by NodeSource.
Their instructions are to run these shell commands to, presumably, set up a PPM and install a current version of node from that source.
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
First you need to install python 2.7 using following commands
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python2.7
then install nodejs
sudo apt-get install nodejs
Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_15.x | sudo -E bash -
sudo apt-get install -y nodejs
Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_15.x | bash -
apt-get install -y nodejs

Package 'npm' has no installation candidate

I want to install npm in Debian 9.
I've tried:
apt-get install nodejs
completely installed and nodejs -v results: v4.8.2.
but when try to run npm an error says:
bash: npm: command not found
Base on my searches I've tried other ways:
based on this guide: https://www.godaddy.com/help/install-nodejs-ubuntu-17395 I've tried:
sudo apt-get install npm
results:
E: Package 'npm' has no installation candidate
Based on another guide I've tried:
wget https://npmjs.org/install.sh
sudo chmod +x install.sh
sudo ./install.sh
results:
npm cannot be installed without node.js.
of course I've installed nodejs. I also tried this way:
curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -
sudo apt-get update
sudo apt-get install --yes nodejs
It says:
nodejs is already the newest version (4.8.2~dfsg-1).
What should I do?
Remove the old version
sudo apt-get purge nodejs
Install the new version:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Alternatively, for Node.js 9:
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
Source
It might tell you that you are missing package gnupg2, just install it.

mysql-server:Depends: mysql-server-5.5 but it is not going to be installed

I am using ubuntu 14.04 on VirtualBox. I try install mysql-server using command
sudo apt-get install mysql-server, i always got error like below:
Some packages could be installed .This may mean that you have
request an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following packages have unmet dependencies:
mysqsl-server : Depends: mysql-server-5.5 but it is not going to be installed
E:Unable to correct problems, you have held broken packages.
and then i try use some command like below :
sudo apt-get update
sudo apt-get upgrade
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get purge mysql-server*
sudo apt-get install mysql-server
but it still error. Please help me!
Have you tried using
sudo apt-get install -f
This can repair broken packages or purge the installation.
If mysql-server is not installed with -f , you can try to install with normal way
sudo apt-get install mysql-server -y

apt-get not installing anything linux server

Anything with apt-get install is giving following error
You might want to run 'apt-get -f install' to correct these:
The
following packages have unmet dependencies:
openssh-server : Depends:
openssh-client (= 1:6.0p1-4) but 1:6.0p1-4+deb7u2 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or
specify a solution).
If i try to install apt-get -f install it give following error
reparing to replace openssh-server 1:6.0p1-4 (using .../openssh-server_1%3a6.0p1-4+deb7u2_amd64.deb) ...
Unpacking replacement openssh-server ...
dpkg: error processing /var/cache/apt/archives/openssh-server_1%3a6.0p1-4+deb7u2_amd64.deb (--unpack):
unable to make backup link of `./usr/sbin/sshd' before installing new version: Operation not permitted
Processing triggers for man-db ...
Errors were encountered while processing:
/var/cache/apt/archives/openssh-server_1%3a6.0p1-4+deb7u2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get update also not working completely. Suggestion please
Thanks in advance
sudo apt-get update
sudo apt-get -f install
sudo apt-get install openssh-server
If you are not logged in as root (as I'm assuming), you should put sudo before adding/removing packages to the system.
If that doesn't work, run these commands:
chattr -i /usr/bin/sshd
chattr -a /usr/bin/sshd
sudo apt-get update
sudo apt-get -f install
sudo apt-get install openssh-server
If that doesn't work, you can also go to /var/lib/dpkg/info and /var/cache/apt/archives to delete anything with a name close to openssh-server. Then, run the commands:
sudo apt-get update
sudo apt-get -f install
sudo apt-get install openssh-server
pd: this is quite complex, so not having access to the system means a lot of "try and fail" :(
Ok I tried all of this and more, and not one of the methods worked. So I tried to remove openssh-client, then install openssh-server and that worked for me.

Resources