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

Please tell me how to create an electron-builder development environment in a Windows. #6820

Closed
KaminoRyo opened this issue Apr 26, 2022 · 9 comments

Comments

@KaminoRyo
Copy link
Contributor

Hi. I would like to small contribute to this project.
I read this document and tried to create a development environment.
But, I'm failing the "pnpm compile" command.
There are some points to be worried about.

  1. When I execute the pnpm install command, I get the error. ERR_PNPM_PREPARE_PKG_FAILURE not found: yarn.
  2. When I execute the yalk link *** command, I get many warning messages. Could not find package `app-builder-lib` in store (C:\Users\***\AppData\Local\Yalc\packages\app-builder-lib), skipping.
  3. When I execute the pnpm compile command, I get the error. ```'tsc' is not recognized as an internal or external command ~~~``

Any information is welcome.

@mmaietta
Copy link
Collaborator

mmaietta commented May 1, 2022

Happy to help!

Re: # 3, tsc (via pnpm compile) will not run because dependencies haven't been installed yet (per # 1 failing)

IIRC yalc link will only work after you've yalc publish <dep name> to the local yalc repo. You'll probably want to refer to yalc's readme, it's been a while since I had set it up 🙂
https://github.com/wclr/yalc

Re: # 1, this is what I found regarding your error code: pnpm/pnpm#4128. My best suggestion is to try a different version of pnpm 🤷

Please make any additions to the CONTRIBUTING doc that you find helps you out!

@KaminoRyo
Copy link
Contributor Author

@mmaietta
Thank you for the information. With pnpm@6.23.1, the error no longer appears.
This is my first time to mono-repo and I've never used pnpm and yalc, so I read the docs and articles and learned a bit.

Question

Do I need to have yarn installed globally?

Sorry, I've never used yarn, and I've been using electron-builder from npm for a long time, so I haven't added it yet.😅
I understand that pnpm and yalc are yarn independent. Install if necessary.

Do you need to do the following steps?

  1. I go to the packages folder
  2. yalc publish <12 packages I need to link>
  3. yalc link <12 packages I need to link>

Still the tsc command is not recognized.

@mmaietta
Copy link
Collaborator

mmaietta commented May 3, 2022

Do I need to have yarn installed globally?

Yarn shouldn't be necessary, you can continue using npm for your project to leverage yalc if you install it globally.

Do you need to do the following steps?

You need to compile the assets first in order for publish to work IIRC

Still the tsc command is not recognized.

pnpm install && pnpm compile don't work for you? I'm able to successfully run them with pnpm@6.32.4
I periodically run into an issue with pnpm@7

This was also my first project working in a mono-repo, so I still stumble a bit from time to time 😅

@KaminoRyo
Copy link
Contributor Author

@mmaietta
Yes. pnpm install && pnpm compile don't work.
It's log.(Occurs on both pnpm@6.23.1 and 6.32.4)

pnpm install

Scope: all 14 workspace projects
 WARN  There are cyclic workspace dependencies: C:\Users\(omit)\Documents\Repository\electron-builder\packages\app-builder-lib, C:\Users\(omit)\Documents\Repository\electron-builder\packages\dmg-builder; C:\Users\(omit)\Documents\Repository\electron-builder\packages\app-builder-lib, C:\Users\(omit)\Documents\Repository\electron-builder\packages\dmg-builder, C:\Users\(omit)\Documents\Repository\electron-builder\packages\app-builder-lib, C:\Users\(omit)\Documents\Repository\electron-builder\packages\electron-builder-squirrel-windows
Lockfile is up-to-date, resolution step is skipped
Packages: +1459
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are copied from the content-addressable store to the virtual store.
Content-addressable store is at: C:\Users\(omit).pnpm-store\v3
Virtual store is at: node_modules/.pnpm
WARN  GET https://codeload.github.com/milahu/patch-package/tar.gz/6b85a8bc1562d1482f30c1b65c9f4e91ba657d39 error (ENOENT). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://codeload.github.com/milahu/patch-package/tar.gz/6b85a8bc1562d1482f30c1b65c9f4e91ba657d39 error (ENOENT). Will retry in 1 minute. 1 retries left.
 ENOENT  not found: yarn

Progress: resolved 1459, reused 1458, downloaded 0, added 0

pnpm compile

@electron-builder/monorepo@ compile C:\Users\(omit)\Documents\Repository\electron-builder
tsc --build

tsc is not a recognized as an internal or external command... (Actually displayed in Japanese)
 ELIFECYCLE  Command failed with exit code 1.


Sorry for my lack of knowledge, do I need to do a pnpm install for 12 packages?
I thought that it would be resolved recursively.

@mmaietta
Copy link
Collaborator

mmaietta commented May 4, 2022

Idk why yarn is needed. But let's go ahead and try installing it globally and see what happens? npm i -g yarn. I use yarn locally on a different project so maybe that's why I am not aware of that requirement

You're correct in your assumption that it resolves recursively. You only need to run pnpm install once on the root workspace

@KaminoRyo
Copy link
Contributor Author

KaminoRyo commented May 5, 2022

The pnpm install and pnpm compile commands were successful with the yarn installed.🎊
A different installation log was displayed.

node_modules/.pnpm/esbuild@0.12.29/node_modules/esbuild: Running postinstall script, done in 3.8s
node_modules/.pnpm/puppeteer@2.1.1/node_modules/puppeteer: Running install script, done in 14.9s

dependencies:

  • dmg-license 1.0.11

devDependencies:

  • @babel/plugin-transform-modules-commonjs 7.15.4
  • @changesets/changelog-github 0.4.2
  • @changesets/cli 2.19.0
  • @milahu/patch-package-with-pnpm-support 6.4.8
  • @types/node 16.7.10
  • @typescript-eslint/eslint-plugin 4.33.0
  • @typescript-eslint/parser 4.33.0
  • conventional-changelog-cli 2.1.1
  • dmd 6.0.0
  • eslint 7.30.0
  • eslint-config-prettier 8.3.0
  • eslint-plugin-prettier 3.4.0
  • fs-extra 10.0.0
  • husky 7.0.1
  • jest-cli 27.0.6
  • jsdoc-to-markdown 7.0.1
  • lint-staged 11.1.2
  • markdown2html-pro 1.0.6
  • path-sort 0.1.0
  • prettier 2.3.2
  • replace-in-file 6.2.0
  • source-map-support 0.5.19
  • ts-jsdoc 3.2.2
  • typescript 4.3.5
  • typescript-json-schema 0.51.0
  • v8-compile-cache 2.3.0

. postinstall$ patch-package
│ Applying patches...
│ @changesets/cli@2.19.0 ✔
. prepare$ husky install

Next, Not in the specified order, but after pnpm compile , yalc publish <12 packages I need to link> in the packages folder. (This command cannot specify multiple packages, so you need to do it 12 times 😫)
In this state, when yalc link <12 packages I need to link> is performed in the project folder (electron-builder), the following log is displayed.

Because of pnpm-workspace.yaml exists in this package --pure option will be used by default, to override use --no-pure.
electron-forge-maker-appimage@23.0.8 added to .yalc\electron-forge-maker-appimage purely
Because of pnpm-workspace.yaml exists in this package --pure option will be used by default, to override use --no-pure.
electron-forge-maker-nsis@23.0.8 added to .yalc\electron-forge-maker-nsis purely
Because of pnpm-workspace.yaml exists in this package --pure option will be used by default, to override use --no-pure.
electron-forge-maker-nsis-web@23.0.8 added to .yalc\electron-forge-maker-nsis-web purely
Because of pnpm-workspace.yaml exists in this package --pure option will be used by default, to override use --no-pure.
electron-forge-maker-snap@23.0.8 added to .yalc\electron-forge-maker-snap purely
Because of pnpm-workspace.yaml exists in this package --pure option will be used by default, to override use --no-pure.
electron-builder@23.0.8 added to .yalc\electron-builder purely
Because of pnpm-workspace.yaml exists in this package --pure option will be used by default, to override use --no-pure.
builder-util@23.0.8 added to .yalc\builder-util purely
Because of pnpm-workspace.yaml exists in this package --pure option will be used by default, to override use --no-pure.
builder-util-runtime@9.0.2 added to .yalc\builder-util-runtime purely
Because of pnpm-workspace.yaml exists in this package --pure option will be used by default, to override use --no-pure.
electron-publish@23.0.8 added to .yalc\electron-publish purely
Because of pnpm-workspace.yaml exists in this package --pure option will be used by default, to override use --no-pure.
electron-builder-squirrel-windows@23.0.8 added to .yalc\electron-builder-squirrel-windows purely
Because of pnpm-workspace.yaml exists in this package --pure option will be used by default, to override use --no-pure.
dmg-builder@23.0.8 added to .yalc\dmg-builder purely
Because of pnpm-workspace.yaml exists in this package --pure option will be used by default, to override use --no-pure.
electron-updater@5.0.3 added to .yalc\electron-updater purely
Because of pnpm-workspace.yaml exists in this package --pure option will be used by default, to override use --no-pure.
app-builder-lib@23.0.8 added to .yalc\app-builder-lib purely

It's not accurate because I don't have any knowledge about workspace, but I think this is okay.
That's all for today.

@mmaietta
Copy link
Collaborator

That's super weird that yarn is required to be installed for that to work, but I'm glad you were able to get your env set up.

Must be a newer version of yalc as I don't recognize those warnings. As long as the dev environment is there working for ya, then all is swell 🤷

@KaminoRyo
Copy link
Contributor Author

@mmaietta
Thank you for your advice.😀
I would like to reflect it in the document. (Although it will be ambiguous due to lack of knowledge ...)

@mmaietta
Copy link
Collaborator

mmaietta commented May 19, 2022

Would you be willing to open a PR on the document with the information you needed to get your env set up? We can iterate on it from there :) It's been a long time since I've had to set up an env and both my dev machines are already configured.

Doc: https://github.com/electron-userland/electron-builder/blob/master/CONTRIBUTING.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants