Weird problem with installation
MRokas opened this issue · 9 comments
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
rokas@ROKAS ~/dev/verse
$ yarn add @types/react -dev
yarn add v0.15.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency
└─ @types/react@0.14.39
Done in 0.89s.
# at this point node_modules has @types/react
rokas@ROKAS ~/dev/verse
$ yarn add @types/react-dom -dev
yarn add v0.15.1
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error ENOENT: no such file or directory, open 'C:\Users\rokas\dev\verse\node_modules\@types\react-dom\index.d.ts'
at Error (native)
info Visit http://yarnpkg.com/en/docs/cli/add for documentation about this command.
# at this point node_modules is empty
$ yarn add @types/react-dom @types/react -dev
yarn add v0.15.1
warning No license field
[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.
├─ @types/react-dom@0.14.17
└─ @types/react@0.14.39
Done in 2.25s.
# at this point it has both of them
rokas@MAZIAI ~/dev/verse
$ yarn add react react-dom
yarn add v0.15.1
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error ENOENT: no such file or directory, open 'C:\Users\rokas\dev\verse\node_modules\@types\react\index.d.ts'
at Error (native)
info Visit http://yarnpkg.com/en/docs/cli/add for documentation about this command.
# at this point @types is gone, it has react/react-dom and their dependencies, however none has package.json
If the current behavior is a bug, please provide the steps to reproduce.
yarn add @types/react @types/react-dom -dev
yarn add react react-dom
What is the expected behavior?
It shouldn't clear
Please mention your node.js, yarn and operating system version.
node@6.3.1
yarn@0.15.1
Windows7 64bit
Seems like there's something specific to Windows happening here, I can only repro on Windows but not Linux.
On Windows:
C:\temp\yarntest
λ c:\src\yarn\bin\yarn add @types/react @types/react-dom -dev
yarn add v0.15.0
info No lockfile found.
[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.
├─ @types/react-dom@0.14.17
└─ @types/react@0.14.39
Done in 1.14s.
C:\temp\yarntest(<invalid_name>@<invalid_version>)
λ c:\src\yarn\bin\yarn add react react-dom
yarn add v0.15.0
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error ENOENT: no such file or directory, open 'C:\temp\yarntest\node_modules\@types\react\index.d.ts'
at Error (native)
info Visit http://yarnpkg.com/en/docs/cli/add for documentation about this command.
On Debian Linux:
10:41 daniel@dan /tmp/yarntest
% /usr/local/src/yarn/bin/yarn add @types/react @types/react-dom -dev
yarn add v0.15.0
info No lockfile found.
[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.
├─ @types/react-dom@0.14.17
└─ @types/react@0.14.39
Done in 2.90s.
10:42 daniel@dan /tmp/yarntest
% /usr/local/src/yarn/bin/yarn add react react-dom
yarn add v0.15.0
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 17 new dependencies.
├─ asap@2.0.5
├─ core-js@1.2.7
├─ encoding@0.1.12
├─ fbjs@0.8.5
├─ iconv-lite@0.4.13
├─ immutable@3.8.1
├─ is-stream@1.1.0
├─ isomorphic-fetch@2.2.1
├─ js-tokens@1.0.3
├─ loose-envify@1.2.0
├─ node-fetch@1.6.3
├─ object-assign@4.1.0
├─ promise@7.1.1
├─ react-dom@15.3.2
├─ react@15.3.2
├─ ua-parser-js@0.7.10
└─ whatwg-fetch@1.0.0
Done in 8.67s.
+1 For me it always works at a second try. But still pls fix.
Same problem here, but it's always a different file under \@types\
. Retrying the command also doesn't work, it's still throwing that error.
Same here -- while it will very often work the 2nd time, another run after that very often fails.
I had similar issue with local packages: "package": "file:./../../package/dir"
on Linux Mint LMDE. Each run resulted in different missing file.
An unexpected error occurred: "ENOENT: no such file or directory,
open '/home/user/.cache/yarn/v1/npm-package-dir-0.9.0/src/index.js'".
where package-dir
was package-name and package resides under ./../../package/dir
.
Update:
yarn@0.22
node@6.10.2
We need to confirm this with the latest Yarn version.
I still get this issue often, with the Yarn 1.2.1 + macOS 10.13 + Node v6.11.3. I've tried for a long time to come up with steps to reproduce, but it seems to happen completely randomly for me.
I'll do a yarn add jquery
, for example. During the linking step, it will sometimes throw an error saying that some dependency of some other dependency (completely unrelated to jquery) doesn't exist.
While it seems to happen randomly, the ansi-styles
package is a common "missing file" that I see in my error messages.
[3/4] 🔗 Linking dependencies..
error An unexpected error occurred: "ENOENT: no such file or directory, open '/path/to/app/node_modules/@someScope/some-dep/node_modules/ansi-styles/index.js'".
Running the same exact yarn add
command again will often fix it. Sometimes it throws the same ENOENT error, but with a different file... and I just end up running yarn add
until it works. Sometimes it works on the first try, sometimes on the second, sometimes on the third, etc...
When it finally does work, the file that it originally errors on (ansi-styles/index.js
) still isn't there, but apparently it's no longer an issue for it?
I've seen this issue across multiple projects using completely independent lists of dependencies. Doing the same exact thing on a project will sometimes trigger this, and sometimes not, in seemingly identical environments.
This may be a complete red herring, but it seems to happen more when my internet traffic is higher, and always with a yarn link
ed package in the error message.
i had this problem..how to solve this mine windows 7 32 bit
C:\xampp\htdocs\project>yarn install
yarn install v1.3.2
[1/4] Resolving packages...
events.js:160
throw er; // Unhandled 'error' event
^
Error: This socket is closed
at WriteStream.Socket._writeGeneric (net.js:679:19)
at WriteStream.Socket._write (net.js:730:8)
at doWrite (_stream_writable.js:331:12)
at writeOrBuffer (_stream_writable.js:317:5)
at WriteStream.Writable.write (_stream_writable.js:243:11)
at WriteStream.Socket.write (net.js:657:40)
at Console.warn (console.js:51:16)
at C:\Program Files\Yarn\lib\cli.js:73181:5
at Array.forEach (native)
at EventEmitter. (C:\Program Files\Yarn\lib\cli.js:73174:24)
C:\xampp\htdocs\project>yarn -v
1.3.2
C:\xampp\htdocs\project>npm -v
3.10.10
Going to close this unless someone can confirm it's still an issue. If so, will reopen