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

Fail to install with yarn in windows, if the folder is not in C drive #4091

Closed
4 tasks done
steelywing opened this issue Jul 31, 2024 · 4 comments
Closed
4 tasks done
Labels
upstream Related to the dependencies

Comments

@steelywing
Copy link

steelywing commented Jul 31, 2024

Describe the bug

Fail to install with yarn in windows, if the folder is not in C drive

Reproduction

On a folder is not in C drive:

yarn init
yarn add -D vitepress vue
yarn vitepress init
yarn run docs:dev

Get this error

  vitepress v1.3.1

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h to show help
✘ [ERROR] Could not read from file: E:/Data/note-vitepress/.yarn/__virtual__/vue-virtual-80b135f193/4/C:/Users/User/AppData/Local/Yarn/Berry/cache/vue-npm-3.4.34-9d9c80aee1-10c0.zip/node_modules/vue/dist/vue.runtime.esm-bundler.js

✘ [ERROR] Could not read from file: E:\Data\note-vitepress\.yarn\__virtual__\vitepress-virtual-046653f2bc\4\C:\Users\User\AppData\Local\Yarn\Berry\cache\vitepress-npm-1.3.1-f5fb335031-10c0.zip\node_modules\vitepress\lib\vue-demi.mjs

    C:/Users/User/AppData/Local/Yarn/Berry/cache/@vueuse-core-npm-10.11.0-fb26847db9-10c0.zip/node_modules/@vueuse/core/index.mjs:3:320:
      3 │ ...xtTick, reactive, markRaw, unref, getCurrentScope, set, del, isReadonly, onBeforeUpdate } from 'vue-demi';
        ╵                                                                                                   ~~~~~~~~~~

Expected behavior

No issue

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (4) x64 Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz
    Memory: 1.03 GB / 7.92 GB
  Binaries:
    Node: 20.15.0 - ~\AppData\Local\Volta\tools\image\node\20.15.0\node.EXE
    Yarn: 4.3.1 - ~\AppData\Local\Volta\tools\image\yarn\4.3.1\bin\yarn.CMD
    npm: 10.7.0 - ~\AppData\Local\Volta\tools\image\node\20.15.0\npm.CMD
    bun: 1.1.21 - ~\.bun\bin\bun.EXE
  Browsers:
    Chrome: 127.0.6533.73
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.4355

Additional context

No response

Validations

@steelywing steelywing added the bug: pending triage Maybe a bug, waiting for confirmation label Jul 31, 2024
@brc-dd
Copy link
Member

brc-dd commented Jul 31, 2024

Do you have read/write access to that .yarn directory?

I don't have a windows device, someone else will need to check.

Can you check once by enabling developer mode in windows - https://www.youtube.com/watch?v=ayo4pefuYAY

Can you try disabling pnp/zero install mode in yarn berry?

@brc-dd brc-dd added need more info Further information is requested and removed bug: pending triage Maybe a bug, waiting for confirmation labels Jul 31, 2024
@steelywing
Copy link
Author

Do you have read/write access to that .yarn directory?

Yes, it's new created directory, it's working if I put the directory in C drive

Can you check once by enabling developer mode in windows - https://www.youtube.com/watch?v=ayo4pefuYAY

Developer mode is enabled

Can you try disabling pnp/zero install mode in yarn berry?

It is working if I set nodeLinker: node-modules

@brc-dd
Copy link
Member

brc-dd commented Aug 1, 2024

Seems like vite doesn't support this. Please track - vitejs/vite#10802 (see linked issues in that thread too)

You can try setting vite: { resolve: { preserveSymlinks: true } } in your vitepress config as some comments mention there.

@brc-dd brc-dd added the upstream Related to the dependencies label Aug 1, 2024
@brc-dd brc-dd closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2024
@brc-dd brc-dd removed the need more info Further information is requested label Aug 1, 2024
@steelywing
Copy link
Author

Seems like vite doesn't support this. Please track - vitejs/vite#10802 (see linked issues in that thread too)

You can try setting vite: { resolve: { preserveSymlinks: true } } in your vitepress config as some comments mention there.

Thanks for the info, while preserveSymlinks: true is not work for me (yarn does not using symlink ?), but set enableGlobalCache: false in .yarnrc.yml works for me.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upstream Related to the dependencies
Projects
None yet
Development

No branches or pull requests

2 participants