yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.39k stars 2.73k forks source link

error ENOENT: no such file or directory, open '...AppFolder\node_modules\@types\node\README.md' at Error (native) #919

Closed wis closed 7 years ago

wis commented 7 years ago

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

What is the current behavior?

λ yarn add angular2-apollo --save
yarn add v0.15.1
warning Angular2Spa@0.0.0: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.0.14: The platform "win32" is incompatible with this module.
info "fsevents@1.0.14" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning Unmet peer dependency "apollo-client@^0.4.0".
warning Unmet peer dependency "apollo-client@^0.4.13".
error ENOENT: no such file or directory, open '<Path to Dir>\AngularSpa\node_modules\@types\node\README.md'
    at Error (native)
info Visit http://yarnpkg.com/en/docs/cli/add for documentation about this command.

If the current behavior is a bug, please provide the steps to reproduce. yarn add angular2-apollo --save

What is the expected behavior? install Node package correctly without this unnecessary error

Please mention your node.js, yarn and operating system version.

λ node -v
v6.3.1

Yarn v0.15.1 install method: MSI installer from website.

OS: Windows 10 Pro Version 1607 (OS Build 14393.321)

wis commented 7 years ago

it just installed without any errors after

λ yarn add angular2-apollo
yarn add v0.15.1
warning Angular2Spa@0.0.0: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.0.14: The platform "win32" is incompatible with this module.
info "fsevents@1.0.14" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning Unmet peer dependency "apollo-client@^0.4.0".
warning Unmet peer dependency "apollo-client@^0.4.13".
error ENOENT: no such file or directory, open '<Path to Dir>\AngularSpa\node_modules\@types\node\index.d.ts'
    at Error (native)
info Visit http://yarnpkg.com/en/docs/cli/add for documentation about this command.

λ yarn add angular2-apollo --save
yarn add v0.15.1
warning Angular2Spa@0.0.0: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.0.14: The platform "win32" is incompatible with this module.
info "fsevents@1.0.14" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning Unmet peer dependency "apollo-client@^0.4.0".
warning Unmet peer dependency "apollo-client@^0.4.13".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 7 new dependencies.
├─ angular2-apollo@0.5.0
├─ apollo-client-rxjs@0.1.0
│  └─ rxjs@5.0.0-rc.1
├─ lodash.assign@4.2.0
├─ lodash.forin@4.4.0
├─ lodash.isfunction@3.0.8
└─ lodash.omit@4.5.0
Done in 26.52s.
hohwille commented 7 years ago

I am facing the same issue with recent version of Yarn v0.16.1 on windows 7. The problem is somewhat indeterministic but in complex projects when I have modified package.json then yarn fails on the first run of "Linking dependencies". When I then run yarn again it works fine. Yarn is already a great improvement over npm. If such quirks would be fixed it will be an awesome rescue.

BTW: I am a user of maven for Java since years. There you have a central repository what is probably the cache folder of yarn in appdata is about. However, instead of duplicating mega- or gigabytes on the disc why dont you just create symlinks (yes also on windows) for the folders in node_modules? I already discussed such things with npm community and gave up as they do not care. Maybe yarn will cure the pain...

mischkl commented 7 years ago

Same problem here on Windows 7 x64 with Node 6.7.0 (when trying to install various packages).

marcomorain commented 7 years ago

Same issue here.

System Version
Yarn 0.15.1
Node v6.2.1
OS Microsoft Windows 10 Pro, 10.0.14393 Build 14393

Output:

C:\Users\Marc\Documents\GitHub\web-order [master ≡ +1 ~3 -0 !]> yarn add  @types/redux-thunk
yarn add v0.15.1
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.0.14: The platform "win32" is incompatible with this module.
info "fsevents@1.0.14" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
error ENOENT: no such file or directory, open 'C:\Users\Marc\Documents\GitHub\web-order\node_modules\@types\classnames\index.d.ts'
    at Error (native)
info Visit http://yarnpkg.com/en/docs/cli/add for documentation about this command.

Package.json.

hohwille commented 7 years ago

Sounds like this issue should be reopened or do we need to file a new issue?

hohwille commented 7 years ago

Currently I have the effect that I get this ENOENT every time I call yarn install. Each time it occurs with a different file and the behaviour is not reproducible but yarn is not yet reliable.

manrueda commented 7 years ago

I'm having the same issue with yarn install

System Version
Yarn v0.16.1
Node v4.5.0
OS Windows Server 2008 R2 (7601.win7sp1_ldr.160930-0600)
rkusuma commented 7 years ago

is it has been fixed?

viktor-nikolaev commented 7 years ago

as a temporal workaround on our build server: (yarn install || yarn install) && yarn run build:prod

wclr commented 7 years ago

@rkusuma those issues refers to windows users, and windows users should suffer =)

AntJanus commented 7 years ago

I'm having an identical issue on windows 10, Node v6.9.1 running it in Powershell:

error An unexpected error occurred: "ENOENT: no such file or directory, lstat 'C:\\Users\\[my username]\\AppData\\Local\\Yarn\\cache\\npm-gulp-4.0.0-alpha.2-58ae6d972ff84fa07ba9cc30cf7d13d9bc646f39'".

Pretty much makes Yarn completely unusable on Windows machines.

wclr commented 7 years ago

@AntJanus I think it is a little bit different issue, the original issue is about disappearing modules from project's node_modules, not cache.

AntJanus commented 7 years ago

@whitecolor time to file a new issue then! Thanks!

ghost commented 7 years ago

I have the same problem. Most of the time yarn install works, but sometimes I get the error that some file in node_modules/@types can not be found.

yarn install v0.17.2 [1/4] Resolving packages... [2/4] Fetching packages... warning fsevents@1.0.15: The platform "win32" is incompatible with this module. info "fsevents@1.0.15" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... error An unexpected error occurred: "ENOENT: no such file or directory, open 'D:\projectX\node_modules\@types\async\index.d.ts'".

Windows 8.1 NodeJS 6.8.1 Yarn 0.17.2

@ManRueda How do you print that pretty table for your specs?

ghost commented 7 years ago

I noticed that @wesamco, @marcomorain, and me all have "fsevents" in their output logs. Coincidence?

viktor-nikolaev commented 7 years ago

@centigrade-thomas-becker it can be easily reproduced following this steps:

  1. yarn add @types\node
  2. yarn install
  3. yarn install whatever-package
  4. ???
  5. Got an error

ie this bug appears anytime you change your package.json what is causing yarn to link dependencies.

marcomorain commented 7 years ago

It's the same for me - it happens after adding a package from the types user namespace on npm to package.json

maybeec commented 7 years ago

Seems to be fixed by #1861 but is not yet released. I tested it on master.

ghost commented 7 years ago

The referenced issue is now marked as resolved: https://github.com/yarnpkg/yarn/issues/1861

charpeni commented 7 years ago

I can confirm that it was fixed. cc @bestander

bestander commented 7 years ago

Thanks, let's close this then