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

Command to create a project from the typescript template actually creates project from base template. #96

Open
dyllandry opened this issue Jan 16, 2023 · 4 comments

Comments

@dyllandry
Copy link

I just read the getting started page and tried out the command for using the typescript template but it just ended up creating a project using the base template.

This command from the getting started page just creates a project with the base template:

npm init electron-app@latest my-app -- --template=webpack-typescript

Instead of that, this works, without the double dashes prior to the options:

npm init electron-app@latest my-app  --template=webpack-typescript

I'm using node v14.19.0 and npm 6.14.16 and my shell is zsh 5.8 (x86_64-apple-darwin21.0)

@erickzhao
Copy link
Member

Can't seem to repro on my end on NPM 8:

> npm init electron-app@latest my-app -- --template=webpack-typescript --force
✔ Locating custom template: "webpack-typescript"
✔ Initializing directory
  › ⚠ The specified path "/Users/erick.zhao/Developer/dump/my-app" is not empty. "force" was set to true, so proceeding to initialize. Files may be overwritten
✔ Preparing template
✔ Initializing template
✔ Installing template dependencies

> cat my-app/package.json | grep plugin-webpack
    "@electron-forge/plugin-webpack": "^6.0.4",

@erickzhao
Copy link
Member

Seems I can repro reliably on NPM 6, though. I think something changed with npm init between major versions. We should probably change the docs so that it can hopefully work with all NPM cersions.

@dyllandry
Copy link
Author

Yeah it worked for me as well when I swapped to node v16.19.0 using nvm which uses npm 8.19.3

Thanks for looking into this. I do think something in the docs would help, or some way of running thats npm version agnostic if possible.

@Ntropish
Copy link

Ntropish commented Jul 6, 2024

I'm using Node v20.11.1 and also found that this kind of command was making the base template.

I used this instead:

npx create-electron-app@latest my-app --template=vite-typescript

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

3 participants