"Yarn: command not found" even after being installed [duplicate] - bash

This question already has answers here:
yarn command not found after installing via npm
(8 answers)
Closed 1 year ago.
I'm trying to install metronic on my computer and for this I need to have yarn installed. So I ran the command :
npm install --global yarn
/Users/cbarrial/.npm-global/bin/yarn -> /Users/cbarrial/.npm-global/lib/node_modules/yarn/bin/yarn.js
/Users/cbarrial/.npm-global/bin/yarnpkg -> /Users/cbarrial/.npm-global/lib/node_modules/yarn/bin/yarn.js
+ yarn#1.16.0
updated 1 package in 0.376s
So I guess the installation is working fine but then if I try the yarn command I'm getting this :
yarn --version
-bash: yarn: command not found
I have no idea where the problem could come from, I already have the latest npm and node.js installed and working fine.

You can install yarn in the next way:
sudo apt-get install curl # Only if you don't have installed curl
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-get update && sudo apt-get install yarn
This way is an alternative to install yarn on debian/ubuntu, but you can find the alternative installation for different operative systems in the official page for Yarn in the section Alternatives

Related

Installing Yarn through Bash shell WSL1

When I run curl, it shows this error:
~$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
gpg: can't connect to the agent: IPC connect call failed
I'm unable to install yarn.
I tried killing:
~$ kill -9 gpg-agent
and restarting:
~$ gpg-agent --daemon
but nothing worked so far. Any advice?
I did this from my root -
npm install -g yarn
Checked if the yarn is installed by -
yarn --version
It worked.
The following worked for me:
sudo apt remove gnupg
sudo apt autoremove
sudo apt install gnupg1
This installs GNUPG Classic. Read more here.

AWS EC2 : sudo: apt-get: command not found error

I have installed Amazon Linux 2 AMI (HVM), SSD Volume Type second number of os in list (AWS console) in my instance.
It connect to putty successfully.
Now I want to install node in my server.
For that I go to /var folder. Then I run this command.
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
And then I got error this.
## Populating apt-get cache...
+ apt-get update
bash: apt-get: command not found
Error executing command, exiting
To fixed this I have fire follow commands.
1) apt-get update
2) sudo apt-get update
3) yum update
4) sudo yum update
Still I have same issue. Anyone can help me.
Install node version manager (nvm) by typing the following at the command line.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
Use nvm to install Node.js because nvm can install multiple versions of Node.js and allow you to switch between them.
Activate nvm by typing the following at the command line.
. ~/.nvm/nvm.sh
Use nvm to install the version of Node.js you intend to use by typing the following at the command line.
nvm install 4.4.5
Installing Node.js also installs the Node Package Manager (npm) so you can install additional modules as needed.
Test that Node.js is installed and running correctly by typing the following at the command line.
node -e "console.log('Running Node.js ' + process.version)"
This should display the following message that confirms the installed version of Node.js running.
Running Node.js v4.4.5
More Info : https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html

Gulp installation error on Laravel in Ubuntu

I run npm install gulp in Ubuntu. Show this error:
My Server is Ubuntu 16.04.
Framework is Laravel 5.6.
ERROR: npm is known not to run on Node.js v4.2.6
Node.js 4 is supported but the specific version you're running has
a bug known to break npm. Please update to at least 4.7.0 to use this
version of npm. You can find the latest release of Node.js at https://nodejs.org/
I run node -v show this message: v4.2.6
I run sudo apt-get install --only-upgrade nodejs show this message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version (9.11.1-1nodesource1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
How to solve this problem?
Try this.. First, Uninstall completely nodejs and npm.
sudo apt remove nodejs npm
Then, reinstall it:
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
Refer: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
Try:
sudo apt-get update
sudo apt-get install nodejs (you already have node so this step is probably not required)
sudo npm install -g gulp
That should resolve your issue.

When I install odoo V9 it say me, "Could not execute command 'lessc'"?

When I try to install odoo_v9 it successfully install, and create demo database it also created, but after install demo database it give me error like "Could not execute command 'lessc'"....
Thanks in advance.
This error occurs almost everytime with a fresh installation of Odoo.
(Especially with Ubuntu 12.04)
First run these three commands in your terminal.
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
Then you install nodejs:
sudo apt-get install nodejs
You can then check version of nodejs using:
node -v
It should be at least greater than > 0.10
npm -v
Should return a version at least > 1.4
Then finally execute the following command, whick will update npm to a newer version as well as install the less plugin:
sudo npm install -g npm
sudo npm install -g less less-plugin-clean-css

Odoo-v9 installtion

I have installed odoo-9 successfully, but it need to install few more packages I think because odoo-9 is dependent on node-less.
Problem :
After installed odoo-9 screen will not render completely, so anyone knows the reason why this happen ?
There is no more help available for odoo-9 and it's dependent packages.
Already refereed:
odoo 9 on Ubuntu Server 14.04 LTS
Odoo forum
Issue has been resolved by installing less.
Less CSS via nodejs
on Linux, use your distribution's package manager to install nodejs and npm.
Important
In debian wheezy and Ubuntu 13.10 and before you need to install nodejs manually:
$ wget -qO- https://deb.nodesource.com/setup | bash -
$ apt-get install -y nodejs
In later debian (>jessie) and ubuntu (>14.04) you may need to add a symlink as npm packages call node but debian calls the binary nodejs
$ apt-get install -y npm
$ sudo ln -s /usr/bin/nodejs /usr/bin/node
Once npm is installed, use it to install less and less-plugin-clean-css:
$ sudo npm install -g less less-plugin-clean-css
For more help Click here
by the way thats a really outdated version of node.
instead of
wget -qO- https://deb.nodesource.com/setup | bash -
use
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
All the other instructions are the same.
You need to install nodejs and less for Ubuntu you need to run :-
sudo curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm install -g less less-plugin-clean-css
after run your issue get resolve .
You can get more details tutorial about odoo installation here odoo Apache Ubuntu
You can chekout this also for dependency and configuration
Documentation

Resources