Reputation: 6027
I have looked at this post:
Yarn error "no such option" with --dev flag but it did not work for me. I did the npm install --global yarn
and it did not work.
yarn version: 0.27
node version: 9.6.1
npm version: 5.6.0
linux-ubuntu: 17.10
commad being run:
yarn add --dev nodemon babel-cli babel-preset-env babel-preset-stage-3
Upvotes: 1
Views: 7958
Reputation: 1
So I solved by uninstalling it:
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 update && sudo apt install yarn
yarn
Upvotes: 0
Reputation: 115
I had a similar problem while running the command:
yarn add --dev eslint prettier eslint-config-airbnb@^15.0.1 eslint-config-prettier eslint-plugin-prettier eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y@^5.1.1
yarn: error: no such option: --dev
adding sudo to the command helped me!
sudo npm install --global yarn
Upvotes: 2
Reputation: 3236
from @Wangai you probably installed $ apt install yarn
Instead use $ sudo npm install --global yarn
, then run your command.
Reference: Yarn error "no such option" with --dev flag
Upvotes: 5