SOLFIND
Web Lens
Portal home

Advanced Installation Instructions | Electron

https://www.electronjs.org/pt/docs/latest/tutorial/installation • 46 KB fetched
Open original page


Advanced Installation Instructions | Electron Ir para o conteúdo principal Electron Documentação API Blog Ferramentas * Electron Forge * Electron Fiddle Comunidade * Governança * Vitrine * Recursos Versões Português * English * Deutsch * Español * Français * 日本語 * Português * Русский * 中文 Pesquisar * Comece Agora * Processos no Electron * Boas práticas * Exemplos * Desenvolvimento * Acessibilidade * Advanced Installation Instructions * ASAR 'Archives' * ASAR Integrity * Boilerplates e CLIs * ES Modules (ESM) in Electron * Electron Fuses * Windows on ARM * Native Node Modules * Distribuição * Testando e Depurando * Referências * Contribuindo * * Desenvolvimento * Advanced Installation Instructions Nesta página Advanced Installation Instructions npm install electron --save-dev The preferred method is to install Electron as a development dependency in your app: npm install electron --save-dev See the Electron versioning doc for info on how to manage Electron versions in your apps. Binary download step ​ Under the hood, Electron's JavaScript API binds to a binary that contains its implementations. This binary is crucial to the function of any Electron app, and is downloaded by default the first time you run Electron in development mode (i.e. electron . ). If you want to install the binary on demand instead, you can run the install-electron bin script included in the electron package: npx install-electron --no Installing prereleases ​ Electron distributes experimental releases of future major versions via npm as well. Nightly builds contain the latest changes from the main branch: npm install electron-nightly --save-dev Alpha and beta builds contain changes slated for the next major version: npm install electron@alpha --save-dev npm install electron@beta --save-dev [!TIP] For more information on available Electron releases, see the Release Status dashboard . Running Electron ad-hoc ​ If you're in a pinch and would prefer to not use npm install in your local project, you can also run Electron ad-hoc using the npx command runner bundled with npm : npx electron . The above command will run the current working directory with Electron. Note that any dependencies in your app will not be installed. Personalização ​ If you want to change the architecture that is downloaded (e.g., x64 on an arm64 machine), you can set the ELECTRON_INSTALL_ARCH environment variable: # Inside an npm script or with npx ELECTRON_INSTALL_ARCH=x64 electron . Supported architectures are a subset of Node.js process.arch values, and include: * x64 (Intel Mac and 64-bit Windows) * ia32 (32-bit Windows) * arm64 (Apple silicon, Windows on ARM, ARM64 Linux) * arm (32-bit ARM) Além de alterar a arquitetura, você pode também especificar a plataforma (ex: win32 , linux , etc.) usando a opção --platform : # Inside an npm script or with npx ELECTRON_INSTALL_PLATFORM=mas electron . Supported platforms are Node-like platform strings : * darwin * mas ( Mac App Store ) * win32 * linux [!TIP] To see all available platform/architecture combinations for a particular release, see the artifacts on Electron's GitHub Releases . Proxies ​ Se você necessitar usar um HTTP proxy, é preciso adicionar a variável para múltiplos valores, ELECTRON_GET_USE_PROXY , além das variáveis de ambientes adicionais, dependendo da versão do Node: * Node 10 and above * Before Node 10 Custom mirrors and caches ​ Durante a instalação, o módulo electron vai se conectar para o @electron/get para fazer o download de binários pré-construídos do Electron para a sua plataforma. Ele fará isso entrando em contato a página de lançamento da GitHub ( https://github.com/electron/electron/releases/tag/v$VERSION , onde $VERSION é a versão exata do Electron). Se você não conseguir acessar o GitHub ou precisar fornecer uma compilação personalizada, poderá fazê-lo fornecendo um espelho ou um diretório de cache existente. Mirror (espelhamento) ​ Você pode usar variáveis de ambiente para substituir a URL base, o caminho no qual procurar por binários Electron e o nome do arquivo binário. The URL used by @electron/get is composed as follows: url = ELECTRON_MIRROR + ELECTRON_CUSTOM_DIR + '/' + ELECTRON_CUSTOM_FILENAME For instance, to use the China CDN mirror: ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" By default, ELECTRON_CUSTOM_DIR is set to v$VERSION . To change the format, use the {{ version }} placeholder. For example, version-{{ version }} resolves to version-5.0.0 , {{ version }} resolves to 5.0.0 , and v{{ version }} is equivalent to the default. As a more concrete example, to use the China non-CDN mirror: ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" ELECTRON_CUSTOM_DIR="{{ version }}" The above configuration will download from URLs such as https://npmmirror.com/mirrors/electron/8.0.0/electron-v8.0.0-linux-x64.zip . If your mirror serves artifacts with different checksums to the official Electron release you may have to set electron_use_remote_checksums=1 directly, or configure it in a .npmrc file, to force Electron to use the remote SHASUMS256.txt file to verify the checksum instead of the embedded checksums. Cache ​ Como alternativa, você pode substituir o cache local. O @electron/get armazenará em cache os binários baixados em um diretório local para não estressar sua rede. Você pode usar essa pasta de cache para fornecer construções personalizadas do Electron ou evitar contato com a rede. * Linux: $XDG_CACHE_HOME ou ~/.cache/electron/ * macOS: ~/Library/Caches/electron/ * Windows: $LOCALAPPDATA/electron/Cache ou ~/AppData/Local/electron/Cache/ Em ambientes que usam versões mais antigas do Electron, você pode encontrar cache também em ~/.electron . Você também pode sobrescrever o local do cache local fornecendo uma variável electron_config_cache de ambiente. The cache contains the version's official zip file as well as a checksum, and is stored as [checksum]/[filename] . A typical cache might look like this: ├── a91b089b5dc5b1279966511344b805ec84869b6cd60af44f800b363bba25b915 │ └── electron-v15.3.1-darwin-x64.zip Solução de Problemas ​ Ao executar o npm install electron , alguns usuários encontram erros de instalação. Em quase todos os casos, esses problemas são resultado de problemas de rede e não de problemas reais com o pacote npm electron . Erros como ELIFECYCLE , EAI_AGAIN , ECONNRESET , e ETIMEDOUT são resultados da falta de internet. A melhor solução é tentar trocar de rede, ou aguardar um pouco e tentar instalar novamente. Se a instalação via npm falhar, você também pode tentar baixar o Electron diretamente do código fonte em electron/electron/releases . Se a instalação falha com um erro EACCESS , você precisará corrgir suas permissões do npm . Se o erro acima persistir, o sinalizador unsafe-perm pode precisar ser definido como true: sudo npm install electron --unsafe-perm=true Em redes mais lentas, pode ser aconselhável usar o sinalizador --verbose para mostrar o progresso do download: npm install --verbose electron Se você precisar forçar um novo download do ativo e o arquivo SHASUM, defina a variável force_no_cache do ambiente para true . Editar esta página Anterior Acessibilidade Avançar ASAR 'Archives' * Binary download step * Installing prereleases * Running Electron ad-hoc * Personalização * Proxies * Custom mirrors and caches * Mirror (espelhamento) * Cache * Solução de Problemas Documentação * Introdução * Referência da API Listas de verificação * Performance * Segurança Ferramentas * Electron Forge * Electron Fiddle Comunidade * Governança * Recursos * Discord * Bluesky * X * Mastodon * Stack Overflow Mais * GitHub * Open Collective * Painel de infraestrutura Direitos autorais © OpenJS Foundation e contribuidores do Electron. Todos os direitos reservados. A OpenJS Foundation possui marcas registradas e utiliza marcas comerciais. Para uma lista de marcas da OpenJS Foundation , consulte nossa Política de Marcas e Lista de Marcas . Marcas e logotipos não indicados na lista de marcas da OpenJS Foundation são marcas™™ ou marcas registradas®® de seus respectivos proprietários. O uso delas não implica qualquer afiliação ou endosso por parte deles. A OpenJS Foundation | Termos de Uso | Política de Privacidade | Estatuto | Código de Conduta | Política de Marcas | Lista de Marcas | Política de Cookies Hosting and infrastructure graciously provided by

Links found on this page

  1. Ir para o conteúdo principal [direct]
  2. Electron [direct]
  3. Documentação [direct]
  4. API [direct]
  5. Blog [direct]
  6. Electron Forge [direct]
  7. Electron Fiddle [direct]
  8. Governança [direct]
  9. Vitrine [direct]
  10. Recursos [direct]
  11. Versões [direct]
  12. English [direct]
  13. Deutsch [direct]
  14. Español [direct]
  15. Français [direct]
  16. 日本語 [direct]
  17. Русский [direct]
  18. 中文 [direct]
  19. Processos no Electron [direct]
  20. Boas práticas [direct]
  21. Exemplos [direct]
  22. Desenvolvimento [direct]
  23. ASAR 'Archives' [direct]
  24. ASAR Integrity [direct]
  25. Boilerplates e CLIs [direct]
  26. ES Modules (ESM) in Electron [direct]
  27. Electron Fuses [direct]
  28. Windows on ARM [direct]
  29. Native Node Modules [direct]
  30. Distribuição [direct]
  31. Testando e Depurando [direct]
  32. Referências [direct]
  33. Contribuindo [direct]
  34. Electron versioning doc [direct]
  35. distributes experimental releases of future major versions [direct]
  36. npx [direct]
  37. process.arch [direct]
  38. Mac App Store [direct]
  39. Electron's GitHub Releases [direct]
  40. Node 10 and above [direct]
  41. Before Node 10 [direct]
  42. @electron/get [direct]
  43. corrgir suas permissões do npm [direct]
  44. unsafe-perm [direct]
  45. Editar esta página [direct]
  46. Segurança [direct]
  47. Discord [direct]
  48. Bluesky [direct]
  49. X [direct]
  50. Mastodon [direct]
  51. Stack Overflow [direct]
  52. GitHub [direct]
  53. Open Collective [direct]
  54. Painel de infraestrutura [direct]
  55. OpenJS Foundation [direct]
  56. Política de Marcas [direct]
  57. Lista de Marcas [direct]
  58. Termos de Uso [direct]
  59. Política de Privacidade [direct]
  60. Estatuto [direct]
  61. Código de Conduta [direct]
  62. Política de Cookies [direct]