Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Cannot add any module that is also an option. #1609

Closed
umamialex opened this issue Nov 2, 2016 · 6 comments
Closed

add: Cannot add any module that is also an option. #1609

umamialex opened this issue Nov 2, 2016 · 6 comments
Labels
cat-bug fixed-in-modern This issue has been fixed / implemented in Yarn 2+.

Comments

@umamialex
Copy link

umamialex commented Nov 2, 2016

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Running yarn add flat results in:

yarn add v0.16.1
error Missing list of packages to add to your project.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Running yarn add flat assert results in:

yarn add v0.16.1                 
[1/4] Resolving packages...      
[2/4] Fetching packages...       
[3/4] Linking dependencies...    
[4/4] Building fresh packages... 
success Saved lockfile.          
success Saved 3 new dependencies.
├─ [email protected]                  
├─ [email protected]                
└─ [email protected]                   
Done in 0.79s.                   

Same thing happens for any package that shares a name with an option flag.

A current workaround is running yarn add -- flat.

If the current behavior is a bug, please provide the steps to reproduce.

Run yarn add flat in any project.

What is the expected behavior?

Yarn should install the module flat and update package.json and yarn.lock.

Please mention your node.js, yarn and operating system version.
node.js: v6.9.1 and v7.0.0
yarn: v0.16.1
OS: Ubuntu v14.04.4 subsystem on Windows 10 Pro

@umamialex umamialex changed the title add: Cannot add module flat. add: Cannot add any module that is also an option. Nov 2, 2016
umamialex added a commit to umamialex/yarn that referenced this issue Nov 2, 2016
This actually does not replicate yarnpkg#1609, but it does show that the
problem is in the CLI script itself and not the add functionality.
umamialex added a commit to umamialex/yarn that referenced this issue Nov 2, 2016
umamialex added a commit to umamialex/yarn that referenced this issue Nov 2, 2016
This actually does not replicate yarnpkg#1609, but it does show that the
problem is in the CLI script itself and not the add functionality.
umamialex added a commit to umamialex/yarn that referenced this issue Nov 2, 2016
@sebmck sebmck added the cat-bug label Nov 2, 2016
@umamialex
Copy link
Author

Looks like it's related to these two commander bugs:
tj/commander.js#471
tj/commander.js#483

umamialex added a commit to umamialex/yarn that referenced this issue Nov 2, 2016
This actually does not replicate yarnpkg#1609, but it does show that the
problem is in the CLI script itself and not the add functionality.
umamialex added a commit to umamialex/yarn that referenced this issue Nov 2, 2016
umamialex added a commit to umamialex/yarn that referenced this issue Nov 2, 2016
umamialex added a commit to umamialex/yarn that referenced this issue Nov 27, 2016
This actually does not replicate yarnpkg#1609, but it does show that the
problem is in the CLI script itself and not the add functionality.
umamialex added a commit to umamialex/yarn that referenced this issue Nov 27, 2016
@iorrah
Copy link

iorrah commented Nov 27, 2017

This might sound obvious but if you are facing this issue, make sure you are not accidentally running yarn add without passing the needed parameters (as the error message suggests) 🙂

$ yarn add
yarn add v1.3.2
error Missing list of packages to add to your project.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

@AlexiRJamal
Copy link

This might sound obvious but if you are facing this issue, make sure you are not accidentally running yarn add without passing the needed parameters (as the error message suggests) 🙂

$ yarn add
yarn add v1.3.2
error Missing list of packages to add to your project.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Wait what parameters to pass?

@shadowspawn
Copy link

Regarding: #1609 (comment)

FYI: tj/commander.js#483 has been fixed by tj/commander.js#494

@odiferousmint
Copy link

odiferousmint commented Nov 3, 2019

This might sound obvious but if you are facing this issue, make sure you are not accidentally running yarn add without passing the needed parameters (as the error message suggests) 🙂

$ yarn add
yarn add v1.3.2
error Missing list of packages to add to your project.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Would you please elaborate? I created a project with vue create (chose yarn) and I cannot do yarn add <package> because I get the error Missing list of packages to add to your project.. Manually editing package.json works. Why cannot I add a dependency? npm install <package> works. It also works with yarn when I run it from inside VSCode. Why?!

@paul-soporan
Copy link
Member

Closing as fixed in v2.

https://yarnpkg.com/getting-started/migration

@paul-soporan paul-soporan added the fixed-in-modern This issue has been fixed / implemented in Yarn 2+. label Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat-bug fixed-in-modern This issue has been fixed / implemented in Yarn 2+.
Projects
None yet
Development

No branches or pull requests

7 participants