不可以本地搭建吗
Biw315 opened this issue · 11 comments
我本地白屏,有点搞不懂了
可以的,clone源码到本地,重新构建就可以了
yarn
yarn build
可以的,clone源码到本地,重新构建就可以了
yarn yarn build
无法解析 @intlify/shared 包的入口文件
root@933a62df7f4b:/Compiler_src/picx# yarn build
yarn run v1.22.19
$ vite build
vite v2.7.13 building for production...
✓ 27 modules transformed.
[vite-plugin-pwa:build] Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@intlify/shared" package
error during build:
Error: Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@intlify/shared" package
at packageEntryFailure (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30629:11)
at resolvePackageEntry (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30625:9)
at tryNodeResolve (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30440:20)
at Object.resolveId (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30257:28)
at /Compiler_src/picx/node_modules/rollup/dist/shared/rollup.js:22879:40
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
可以的,clone源码到本地,重新构建就可以了
yarn yarn build无法解析 @intlify/shared 包的入口文件 root@933a62df7f4b:/Compiler_src/picx# yarn build yarn run v1.22.19 $ vite build vite v2.7.13 building for production... ✓ 27 modules transformed. [vite-plugin-pwa:build] Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@intlify/shared" package error during build: Error: Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@intlify/shared" package at packageEntryFailure (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30629:11) at resolvePackageEntry (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30625:9) at tryNodeResolve (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30440:20) at Object.resolveId (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30257:28) at /Compiler_src/picx/node_modules/rollup/dist/shared/rollup.js:22879:40 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
切npm试试看
可以的,clone源码到本地,重新构建就可以了
yarn yarn build无法解析 @intlify/shared 包的入口文件 root@933a62df7f4b:/Compiler_src/picx# yarn build yarn run v1.22.19 $ vite build vite v2.7.13 building for production... ✓ 27 modules transformed. [vite-plugin-pwa:build] Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@intlify/shared" package error during build: Error: Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@intlify/shared" package at packageEntryFailure (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30629:11) at resolvePackageEntry (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30625:9) at tryNodeResolve (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30440:20) at Object.resolveId (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30257:28) at /Compiler_src/picx/node_modules/rollup/dist/shared/rollup.js:22879:40 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
切npm试试看
好快的回复速度...
也是一样的问题,我先是
npm install
npm run build
构建不通过,才来翻issue的
root@933a62df7f4b:/Compiler_src/picx# npm install
npm WARN deprecated @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated trim@0.0.1: Use String.prototype.trim() instead
npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
> picx@2.3.6 prepare
> husky install
husky - Git hooks installed
added 1245 packages, and audited 1246 packages in 57s
225 packages are looking for funding
run `npm fund` for details
18 vulnerabilities (5 moderate, 13 high)
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
root@933a62df7f4b:/Compiler_src/picx# npm run build
> picx@2.3.6 build
> vite build
vite v2.7.13 building for production...
✓ 27 modules transformed.
[vite-plugin-pwa:build] Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@intlify/shared" package
error during build:
Error: Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@intlify/shared" package
at packageEntryFailure (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30629:11)
at resolvePackageEntry (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30625:9)
at tryNodeResolve (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30440:20)
at Object.resolveId (/Compiler_src/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30257:28)
at /Compiler_src/picx/node_modules/rollup/dist/shared/rollup.js:22879:40
冒昧问一下你的构建环境?
@zishume 好的,我再试试
@zishume
node 14.17.6报错
yarn
error vue-i18n@9.3.0: The engine "node" is incompatible with this module. Expected version ">= 16". Got "14.17.6"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
node 14.5.0 报错
yarn
error vue-i18n@9.3.0: The engine "node" is incompatible with this module. Expected version ">= 16". Got "14.5.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command
node 16.0.0 报错
yarn
error write-file-atomic@5.0.1: The engine "node" is incompatible with this module. Expected version "^14.17.0 || ^16.13.0 || >=18.0.0". Got "16.0.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
node 16.13.0 报错
node 18.0.0 报错
与之前相同
root@510edfb925a0:/picx# yarn build
yarn run v1.22.18
$ vite build
vite v2.7.13 building for production...
✓ 27 modules transformed.
[vite-plugin-pwa:build] Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@intlify/shared" package
error during build:
Error: Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@intlify/shared" package
at packageEntryFailure (/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30629:11)
at resolvePackageEntry (/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30625:9)
at tryNodeResolve (/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30440:20)
at Object.resolveId (/picx/node_modules/vite/dist/node/chunks/dep-f5552faa.js:30257:28)
at /picx/node_modules/rollup/dist/shared/rollup.js:22879:40
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@Biw315 @zishume
我用 yarn 和 npm install 都不能构建,看到 pnpm-lock.yaml 文件,查了一下换成 pnpm就可以了
可用 docker 环境
docker run -d --rm --name node-compiler -v ~/Compiler_dir:/Compiler_dir node tail -f /dev/null
docker exec -it node-compiler /bin/bash
##容器中
cd Compiler_dir
git clone https://github.com/XPoet/picx.git
cd picx
npm install -g pnpm
pnpm install
pnpm run build
取用 picx/dist 目录
@zishume
win下没尝试
依赖版本是用 pnpm-lock.yaml 锁定的,
vue-i18n和write-file-atomic的错误是在npm或yarn时跳版本了,和项目要求的版本不对应,可能你的外部依赖库刚好能满足
PicX 不建议自己额外部署,其本身在一直迭代维护中,直接使用作者提供的 picx.xpoet.cn 就好,能为你减少很多不必要的麻烦。