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 failed 构建失败 #1209

Closed
3 tasks done
Tyh2001 opened this issue Aug 19, 2022 · 14 comments · Fixed by #1217
Closed
3 tasks done

Build failed 构建失败 #1209

Tyh2001 opened this issue Aug 19, 2022 · 14 comments · Fixed by #1217
Labels
bug Something isn't working build Related to the build system

Comments

@Tyh2001
Copy link

Tyh2001 commented Aug 19, 2022

Describe the bug

在使用 vitepress v1.0.0-alpha.8 版本在构建项目之后打包会抛出异常错误信息,导致打包失败:

经过测试,在 vitepress v1.0.0-alpha.5 以后的版本中都存在这个问题

PS D:\项目-我的\vitepress-demo> pnpm build 

> vitepress-demo@ build D:\项目-我的\vitepress-demo
> vitepress build docs

vitepress v1.0.0-alpha.8
build error:
 Error: EPERM: operation not permitted, symlink 'D:\项目-我的\vitepress-demo\node_modules\.pnpm\vue@3.2.3    at linkVue (file:///D:/%E9%A1%B9%E7%9B%AE-%E6%88%91%E7%9A%84/vitepress-demo/node_modules/.pnpm/vitepress@1.0.0-alpha.8/node_modules/vitepress/dist/node/serve-cd8de79e.js:40713:11)
    at build (file:///D:/%E9%A1%B9%E7%9B%AE-%E6%88%91%E7%9A%84/vitepress-demo/node_modules/.pnpm/vitepress@1.0.0-alpha.8/node_modules/vitepress/dist/node/serve-cd8de79e.js:40646:21)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {  errno: -4048,
  syscall: 'symlink',  code: 'EPERM',
  path: 'D:\\项目-我的\\vitepress-demo\\node_modules\\.pnpm\\vue@3.2.37\\node_modules\\vue',
  dest: 'D:\\项目-我的\\vitepress-demo\\docs\\node_modules\\vue'
}
 ELIFECYCLE  Command failed with exit code 1.

Reproduction

初始化项目

pnpm init

向package.json添加一些脚本

  "scripts": {
    "dev": "vitepress dev docs",
    "build": "vitepress build docs",
    "serve": "vitepress serve docs"
  },
pnpm i vitepress vue

mkdir docs && echo '# Hello VitePress' > docs/index.md

pnpm build

Expected behavior

构建成功

System Info

PS D:\项目-我的\vitepress-demo> pnpm build 

> vitepress-demo@ build D:\项目-我的\vitepress-demo
> vitepress build docs

vitepress v1.0.0-alpha.8
build error:
 Error: EPERM: operation not permitted, symlink 'D:\项目-我的\vitepress-demo\node_modules\.pnpm\vue@3.2.3    at linkVue (file:///D:/%E9%A1%B9%E7%9B%AE-%E6%88%91%E7%9A%84/vitepress-demo/node_modules/.pnpm/vitepress@1.0.0-alpha.8/node_modules/vitepress/dist/node/serve-cd8de79e.js:40713:11)
    at build (file:///D:/%E9%A1%B9%E7%9B%AE-%E6%88%91%E7%9A%84/vitepress-demo/node_modules/.pnpm/vitepress@1.0.0-alpha.8/node_modules/vitepress/dist/node/serve-cd8de79e.js:40646:21)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {  errno: -4048,
  syscall: 'symlink',  code: 'EPERM',
  path: 'D:\\项目-我的\\vitepress-demo\\node_modules\\.pnpm\\vue@3.2.37\\node_modules\\vue',
  dest: 'D:\\项目-我的\\vitepress-demo\\docs\\node_modules\\vue'
}
 ELIFECYCLE  Command failed with exit code 1.

Additional context

09169be6c8894447b745ad751f926d7
0eb22af646e12f7442eba3ce806d02a

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.
@Tyh2001 Tyh2001 added the bug: pending triage Maybe a bug, waiting for confirmation label Aug 19, 2022
@Hacker-C
Copy link

Same problem, but there is no error with yarn or npm

@Tyh2001
Copy link
Author

Tyh2001 commented Aug 19, 2022

Same problem, but there is no error with yarn or npm

我使用 npm 、yarn、pnpm 都会这样

@Hacker-C
Copy link

Same problem, but there is no error with yarn or npm

我使用 npm 、yarn、pnpm 都会这样

切换为 yarn/npm 之前,node_modules 和 lock 文件删了吗?然后重新 install。

@Tyh2001
Copy link
Author

Tyh2001 commented Aug 19, 2022

Same problem, but there is no error with yarn or npm

我使用 npm 、yarn、pnpm 都会这样

切换为 yarn/npm 之前,node_modules 和 lock 文件删了吗?然后重新 install。

全面都删除了,重新安装的

@brc-dd
Copy link
Member

brc-dd commented Aug 19, 2022

Which operating systems are you guys using?

@Tyh2001
Copy link
Author

Tyh2001 commented Aug 19, 2022

Which operating systems are you guys using?

windows 11

@brc-dd brc-dd added bug Something isn't working build Related to the build system and removed bug: pending triage Maybe a bug, waiting for confirmation labels Aug 19, 2022
@brc-dd
Copy link
Member

brc-dd commented Aug 19, 2022

Ah, on Windows you need to enable dev mode to create symlinks without root access.

@Tyh2001
Copy link
Author

Tyh2001 commented Aug 19, 2022

Ah, on Windows you need to enable dev mode to create symlinks without root access.

那为什么在 vitepress v1.0.0-alpha.5 版本之前都是可以正常使用的,但是在后续的新版本中都相同问题

@Hacker-C
Copy link

Which operating systems are you guys using?

windows 11

My yarn and npm is on the WSL, there is no error with them. But my pnpm is on Windows, so it caused errors. Maybe this is a new bug in this version.

@brc-dd
Copy link
Member

brc-dd commented Aug 19, 2022

那为什么在 vitepress v1.0.0-alpha.5 版本之前都是可以正常使用的,但是在后续的新版本中都相同问题

It was added here 3b2d90a. For now you can consider enabling dev mode. We are looking for a way to fix this.


My yarn and npm is on the WSL, there is no error with them. But my pnpm is on Windows, so it caused errors. Maybe this is a new bug in this version.

Yeah there won't be any issues inside WSL as it's basically a Linux layer. On macOS and other *nix, this shouldn't cause any issue as well.

@free-heart
Copy link

临时解决方案:以管理员权限运行 cmd,但是 build 之后,会在docs文件夹下面生成 node_modules 文件夹,下次再 build 的时候,需要先删除 docs文件夹下面的 node_modules 文件夹

@Tyh2001
Copy link
Author

Tyh2001 commented Aug 19, 2022

临时解决方案:以管理员权限运行 cmd,但是 build 之后,会在docs文件夹下面生成 node_modules 文件夹,下次再 build 的时候,需要先删除 docs文件夹下面的 node_modules 文件夹

哦哦,我尝试使用管理员身份运行 cmd 打包成功了,是预期的结果。

但是我认为这仍然是个问题

@less-js
Copy link

less-js commented Aug 19, 2022

Which operating systems are you guys using?

macOS Monterey 12.5.1 也这样的,npm、yarn都不行

@less-js
Copy link

less-js commented Aug 19, 2022

mac 下使用 sudo 操作也不行哦

@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 Something isn't working build Related to the build system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants