最新的 vue 源码地址
git clone https://github.com/vuejs/core.git
旧版地址
git clone https://github.com/vuejs/vue.git
安装包
pnpm install
报错:Failed to set up chrome-headless-shell v136.0.7103.94! Set "P…
│ at downloadBrowser
│ **INFO** Skipping Firefox download as instructed.
│ Error: ERROR: Failed to set up chrome-headless-shell v136.0.7103.94! Set "P…
│ at downloadBrowser (file:///home/huyunan/vuejs-core/node_modules/.pnpm/…
│ at process.processTicksAndRejections (node:internal/process/task_queues…
│ at async Promise.all (index 1)
│ at async downloadBrowsers (file:///home/huyunan/vuejs-core/node_modules…
│ [cause]: Error: read ECONNRESET
│ at TLSWrap.onStreamRead (node:internal/stream_base_commons:216:20) {
│ errno: -104,
│ code: 'ECONNRESET',
│ syscall: 'read'
│ }
│ }
└─ Failed in 1.3s at /home/huyunan/vuejs-core/node_modules/.pnpm/puppeteer@24.9.0_typescript@5.6.3/node_modules/puppeteer
执行命令忽略 PUPPETEER_SKIP_DOWNLOAD 下载
export PUPPETEER_SKIP_DOWNLOAD='true'
然后可以换 cnpm 源单独下载 puppeteer,或是用国内源下载
再次执行
pnpm install
成功
执行命令
npm run build
进入 vue 目录 packages/vue/examples
里面的 html 文件会自动引入 build 生成的 vue 文件,可以先看下 dist 目录有没有生成引入的文件
<script src="../../dist/vue.global.js"></script>
然后用浏览器打开 html 文件即可