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

Build script does not work with Yarn Berry #435

Closed
3 tasks done
thefrana opened this issue Nov 1, 2021 · 3 comments · Fixed by #439
Closed
3 tasks done

Build script does not work with Yarn Berry #435

thefrana opened this issue Nov 1, 2021 · 3 comments · Fixed by #439
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@thefrana
Copy link

thefrana commented Nov 1, 2021

Describe the bug

I created a new project by following the instructions here. I only added yarn set version berry. Also, there is a small undocumented issue that I had to manually add Vue 3 dependency.

When I run yarn docs:build, it does not work.

vitepress v0.20.0
⠸ building client + server bundles...EROFS: read-only filesystem, mkdir '/node_modules/vitepress/dist/client/app/temp'
✖ building client + server bundles...
build error:
 [Error: ENOTDIR: not a directory, unlink '/home/lukeeno/vitepress-starter/.yarn/cache/vitepress-npm-0.20.0-e06cb3d514-59d85243c3.zip/node_modules/vitepress/dist/client/app/temp'] {
  errno: -20,
  code: 'ENOTDIR',
  syscall: 'unlink',
  path: '/home/lukeeno/vitepress-starter/.yarn/cache/vitepress-npm-0.20.0-e06cb3d514-59d85243c3.zip/node_modules/vitepress/dist/client/app/temp'
}

Reproduction

mkdir vitepress-starter && cd vitepress-starter
yarn init -y
yarn set version berry
yarn add --dev vitepress vue@^3.2.13
mkdir docs && echo '# Hello VitePress' > docs/index.md
yarn vitepress build docs

Expected behavior

It should build the docs.

System Info

System:
    OS: Linux 5.14 undefined
    CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics
    Memory: 3.50 GB / 15.50 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 16.11.1 - /usr/bin/node
    Yarn: 3.1.0 - /usr/bin/yarn
    npm: 8.1.0 - /usr/bin/npm
  Browsers:
    Chromium: 95.0.4638.54
    Firefox: 93.0

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@thefrana thefrana added the bug: pending triage Maybe a bug, waiting for confirmation label Nov 1, 2021
@thefrana
Copy link
Author

thefrana commented Nov 1, 2021

When I use nodeLinker: "node-modules", it works. So this applies only to Plug'n'Play.

jonaskuske added a commit to jonaskuske/vitepress that referenced this issue Nov 9, 2021
package root can be read-only when install strategies like PnP are used, so the tempDir needs to be outside the vitepress package itself

close vuejs#435
@jonaskuske
Copy link
Contributor

This happens because Yarn PnP installs packages as read-only, so packages can't write into their install directory. Unfortunately vitepress' current tempDir is set to its install location, so yarn throws this error.

A quick fix without having to switch over to nodeLinker entirely is to run yarn unplug vitepress, which installs vitepress in a regular, writable directory instead of a read-only zip archive.

The real fix is to change the tempDir to somewhere outside the vitepress package root, as my PR does.

@thefrana
Copy link
Author

thefrana commented Nov 9, 2021

Thank you very much! You are right. I also thought it is because of the read-only zip files, but wasn't sure. Thanks for PR. Looking forward to use your fix. You are quick! 🥳

yyx990803 pushed a commit that referenced this issue Jan 6, 2022
package root can be read-only when install strategies like PnP are used, so the tempDir needs to be outside the vitepress package itself

close #435
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants