Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yarn install command error No such file or directory: 'install'

I am installing sylius bundle and while install sylius I need to run yarn install So While I run the command:

yarn install 

I get the error:

ERROR: [Errno 2] No such file or directory: 'install'

like image 457
Ricky ponting Avatar asked Sep 02 '17 12:09

Ricky ponting


People also ask

What is the command to install yarn?

The Yarn maintainers recommend installing Yarn globally by using the NPM package manager, which is included by default with all Node. js installations. Use the -g flag with npm install to do this: sudo npm install -g yarn.

How do I fix command not found on yarn?

To solve the error "yarn: command not found", install the yarn package globally by running npm install -g yarn and restart your terminal. If the command fails, run it with sudo and make sure the correct PATH is set in your system's environment variable.

Can I install yarn without npm?

js without npm, the recommended node package manager using yarn. Yarn is a wonderful package manager. Like npm, if you have a project folder with package. json containing all the required dependencies mentioned for the project, you can use yarn to install all the dependencies.

Is npm compatible with yarn?

Yarn can consume the same package. json format as npm, and can install any package from the npm registry. This will lay out your node_modules folder using Yarn's resolution algorithm that is compatible with the node.


Video Answer


2 Answers

I had the same issue on Ubuntu 17.04.

This solution worked for me:

sudo apt remove cmdtest sudo apt remove yarn 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 -y 

then

yarn install 

result:

yarn install v1.3.2 warning You are using Node "6.0.0" which is not supported and may encounter bugs or unexpected behaviour. Yarn supports the following server range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0" info No lockfile found. [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages...  info Lockfile not saved, no dependencies. Done in 0.20s. 
like image 120
zappee Avatar answered Sep 20 '22 11:09

zappee


I had the same issue on Ubuntu 18.04. This was what worked for me:

I removed cmdtest and yarn

sudo apt remove cmdtest  sudo apt remove yarn 

Install yarn globally using npm

sudo npm install -g yarn 
like image 22
NetEmmanuel Avatar answered Sep 19 '22 11:09

NetEmmanuel