Skip to content

Document NODE_INSTALLER flag #3164

Closed
Closed

Description

@Konglomneshued

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

^6.0.5

Electron version

23.0.0

Operating system

Fedora Linux 37

Last known working Electron Forge version

No response

Expected behavior

Using npm init electron-app@latest untitled2 -- --template=webpack-typescript will create an NPM project.

Actual behavior

Using npm init electron-app@latest untitled2 -- --template=webpack-typescript will create a Yarn project.

Running the npm installation creates a Yarn project

Running the npm installation creates a Yarn project

Steps to reproduce

  1. npm init electron-app@latest untitled2 -- --template=webpack-typescript
  2. cd untitled2
  3. Look at generated folders and files, they're for Yarn.

Additional information

No response

Activity

  1. self-assigned this
    on Feb 16, 2023
  2. uncaught commented on May 26, 2023

    @uncaught

    I'm running into actual errors because of this:

    npm init electron-app@latest my-new-app -- --template=webpack-typescript
    ✔ Locating custom template: "webpack-typescript"
    ✔ Initializing directory
    ✔ Preparing template
    ✔ Initializing template
    ⚠ Installing template dependencies
      ✔ Installing production dependencies
      ✖ Failed to install modules: ["@electron-forge/plugin-webpack@^6.1.1","@typescript-eslint/eslint-plugin@^5.0.0","@typescript-eslint/parser@^5.0.0","@vercel/[email protected]","css-loader@^6.0.0","eslint@^8.0.1","eslint-plugin-import@^2.25.0","fork-ts-check…
        With output: Command failed with a non-zero return code (2):
        yarn add @electron-forge/plugin-webpack@^6.1.1 @typescript-eslint/eslint-plugin@^5.0.0 @typescript-eslint/parser@^5.0.0 @vercel/[email protected] css-loader@^6.0.0 eslint@^8.0.1 eslint-plugin-import@^2.25.0 fork-ts-checker-webpack-plugin@^7.2.13 node-loa…
        Usage: yarn [options]
        yarn: error: no such option: --dev
        Usage: yarn [options]
        yarn: error: no such option: --dev
      ✖ Failed to install modules: ["electron-squirrel-startup"]
        With output: Command failed with a non-zero return code (1):
        yarn add electron-squirrel-startup
        ERROR: [Errno 2] No such file or directory: 'add'
        ERROR: [Errno 2] No such file or directory: 'add'

    I have some weird /usr/bin/yarn in WSL that looks like a python script. I suppose the npm init running that pyhton script fails miserably.

  3. thehans commented on May 26, 2023

    @thehans

    Quoting a comment from @erickzhao in my issue #3240 (closed as duplicate):

    There's an undocumented NODE_INSTALLER environment variable that you can use as a workaround for this issue. Passing in NODE_INSTALLER=npm as an env var should work for instance.

    This worked for me.

  4. changed the title [-]npm init script creates yarn project[/-] [+]Document `NODE_INSTALLER` flag[/+] on Feb 1, 2025
  5. erickzhao commented on Feb 8, 2025

    @erickzhao
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions