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

yarn add fails #2043

Closed
maffelbaffel opened this issue Nov 26, 2016 · 11 comments
Closed

yarn add fails #2043

maffelbaffel opened this issue Nov 26, 2016 · 11 comments

Comments

@maffelbaffel
Copy link

maffelbaffel commented Nov 26, 2016

Do you want to request a feature or report a bug?
bug
What is the current behavior?
yarn add --dev some_package fails because it somehow deletes @types directory in node_modules.
If the current behavior is a bug, please provide the steps to reproduce.

  • yarn init
  • yarn add --dev protractor
  • check node_modules/@types/jasmineexists
  • yarn add --dev karma-sourcemap-loader
  • add fails because
error An unexpected error occurred: "ENOENT: no such file or directory, open 'C:\\Dev\\Projekte\\yarn_add\\node_modules\\@types\\jasmine\\index.d.ts'".
  • check node_modules/@types does not exists

What is the expected behavior?
yarn add --dev karma-sourcemap-loader should not delete folders in node_modules and add it to devDependencies

Please mention your node.js, yarn and operating system version.
node 6.9.1
yarn 0.17.8
windows 10

@maffelbaffel
Copy link
Author

yarn-error.txt

@TheLudd
Copy link

TheLudd commented Nov 26, 2016

Cannot reproduce.

node: 6.2.1 and 6.9.1
yarn 0.17.8 and 0.17.9
os: ubuntu 16.04

@torifat
Copy link
Member

torifat commented Nov 26, 2016

I have tried it on both macOS & ubuntu and it's working. Need someone to test it on Windows.

@nicole-ashley
Copy link

nicole-ashley commented Nov 27, 2016

This drives me pretty batty. On small projects you can usually run add again and it fixes it, but on larger projects there is usually more than one module playing up and it alternates between missing files in each of them, so you can never get anything done.

λ ver
Microsoft Windows [Version 10.0.14971]

λ node -v
v6.9.1

λ yarn init
yarn init v0.17.9
question name (test):
question version (1.0.0):
question description:
question entry point (index.js):
question git repository:
question author:
question license (MIT):
success Saved package.json
Done in 11.02s.

λ yarn add --dev protractor
yarn add v0.17.9
info No lockfile found.
[1/4] Resolving packages...
warning protractor > jasmine > glob > minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 117 new dependencies.
├─ @types/jasmine@2.5.38
├─ @types/node@6.0.51
├─ @types/q@0.0.32
├─ @types/selenium-webdriver@2.53.35
├─ adm-zip@0.4.7
├─ agent-base@2.0.1
├─ ansi-regex@2.0.0
├─ ansi-styles@2.2.1
├─ array-union@1.0.2
├─ array-uniq@1.0.3
├─ arrify@1.0.1
├─ asn1@0.2.3
├─ assert-plus@0.2.0
├─ asynckit@0.4.0
├─ aws-sign2@0.6.0
├─ aws4@1.5.0
├─ balanced-match@0.4.2
├─ bcrypt-pbkdf@1.0.0
├─ boom@2.10.1
├─ brace-expansion@1.1.6
├─ caseless@0.11.0
├─ chalk@1.1.3
├─ combined-stream@1.0.5
├─ commander@2.9.0
├─ concat-map@0.0.1
├─ cryptiles@2.0.5
├─ dashdash@1.14.1
├─ debug@2.3.3
├─ del@2.2.2
├─ delayed-stream@1.0.0
├─ ecc-jsbn@0.1.1
├─ escape-string-regexp@1.0.5
├─ exit@0.1.2
├─ extend@3.0.0
├─ extsprintf@1.0.2
├─ forever-agent@0.6.1
├─ form-data@2.1.2
├─ fs.realpath@1.0.0
├─ generate-function@2.0.0
├─ generate-object-property@1.2.0
├─ getpass@0.1.6
├─ glob@7.1.1
├─ globby@5.0.0
├─ graceful-readlink@1.0.1
├─ har-validator@2.0.6
├─ has-ansi@2.0.0
├─ hawk@3.1.3
├─ hoek@2.16.3
├─ http-signature@1.1.1
├─ https-proxy-agent@1.0.0
├─ inflight@1.0.6
├─ inherits@2.0.3
├─ ini@1.3.4
├─ is-my-json-valid@2.15.0
├─ is-path-cwd@1.0.0
├─ is-path-in-cwd@1.0.0
├─ is-path-inside@1.0.0
├─ is-property@1.0.2
├─ is-typedarray@1.0.0
├─ isstream@0.1.2
├─ jasmine-core@2.4.1
├─ jasmine@2.4.1
├─ jasminewd2@0.0.10
├─ jodid25519@1.0.2
├─ jsbn@0.1.0
├─ json-schema@0.2.3
├─ json-stringify-safe@5.0.1
├─ jsonpointer@4.0.0
├─ jsprim@1.3.1
├─ lru-cache@2.7.3
├─ mime-db@1.25.0
├─ mime-types@2.1.13
├─ minimatch@3.0.3
├─ minimist@1.2.0
├─ ms@0.7.2
├─ oauth-sign@0.8.2
├─ object-assign@4.1.0
├─ once@1.4.0
├─ optimist@0.6.1
├─ options@0.0.6
├─ path-is-absolute@1.0.1
├─ path-is-inside@1.0.2
├─ pify@2.3.0
├─ pinkie-promise@2.0.1
├─ pinkie@2.0.4
├─ protractor@4.0.11
├─ punycode@1.4.1
├─ q@1.4.1
├─ qs@6.3.0
├─ request@2.79.0
├─ rimraf@2.5.4
├─ saucelabs@1.3.0
├─ sax@0.6.1
├─ selenium-webdriver@2.53.3
├─ semver@5.3.0
├─ sigmund@1.0.1
├─ sntp@1.0.9
├─ source-map-support@0.4.6
├─ source-map@0.5.6
├─ sshpk@1.10.1
├─ stringstream@0.0.5
├─ strip-ansi@3.0.1
├─ supports-color@2.0.0
├─ tmp@0.0.24
├─ tough-cookie@2.3.2
├─ tunnel-agent@0.4.3
├─ tweetnacl@0.14.3
├─ ultron@1.0.2
├─ uuid@3.0.0
├─ verror@1.3.6
├─ webdriver-manager@10.2.8
├─ wordwrap@0.0.3
├─ wrappy@1.0.2
├─ ws@1.1.1
├─ xml2js@0.4.4
├─ xmlbuilder@8.2.2
└─ xtend@4.0.1
Done in 7.26s.

λ ls node_modules\@types\jasmine\
README.md  index.d.ts  package.json  types-metadata.json

λ yarn add --dev karma-sourcemap-loader
yarn add v0.17.9
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error An unexpected error occurred: "ENOENT: no such file or directory, open 'C:\\c\\test\\node_modules\\@types\\jasmine\\index.d.ts'".
info If you think this is a bug, please open a bug report with the information provided in "C:\\c\\test\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

λ ls node_modules\@types\jasmine\
ls: cannot access node_modules\@types\jasmine\: No such file or directory

λ yarn add --dev karma-sourcemap-loader
yarn add v0.17.9
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 2 new dependencies.
├─ graceful-fs@4.1.11
└─ karma-sourcemap-loader@0.3.7
Done in 5.82s.

λ ls node_modules\@types\jasmine\
README.md  index.d.ts  package.json  types-metadata.json

And the yarn-error.log.

@onemen
Copy link

onemen commented Nov 28, 2016

@torifat
I have tried version 0.17.9 and it's working on windows 10.

node: 7.2.0
yarn 0.17.9
windows 10

@maybeec
Copy link

maybeec commented Nov 28, 2016

Might be as well fixed by #1861 but is not yet released. Should be tested on master branch.

@nicole-ashley
Copy link

nicole-ashley commented Nov 28, 2016

@onemen / @torifat: Not working using node 7.2.0 for me.

@onemen
Copy link

onemen commented Nov 28, 2016

After more testing:
with 0.17.9 - after yarn add --dev protractor @types folder contained 4 sub folders jasmine, node, q, selenium-webdriver with 4 files each index.d.ts, package.json, README.md, types-metadata.json
after installing karma yarn add --dev karma-sourcemap-loader the @types folder and its sub folder removed!
No error was reported.

with master (ac90c23) everything work as expected

@nicole-ashley
Copy link

nicole-ashley commented Dec 4, 2016

Can confirm, this appears to be fixed in v0.18.0.

@wyze
Copy link
Member

wyze commented Dec 5, 2016

Going to close with reports of this being resolved with v0.18.0. @maffelbaffel, please let us know if it is still an issue after you upgrade.

@wyze wyze closed this as completed Dec 5, 2016
@wyze wyze added cat-bug and removed needs triage labels Dec 5, 2016
@maffelbaffel
Copy link
Author

@wyze works as expected. Thanks alot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants