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

npm init creates empty package on Windows #11

Closed
phenomen opened this issue Apr 18, 2022 · 4 comments
Closed

npm init creates empty package on Windows #11

phenomen opened this issue Apr 18, 2022 · 4 comments

Comments

@phenomen
Copy link

npm init @svelteness/kit-docs mydocs

PS D:\Github\lancer-docs> npm init @svelteness/kit-docs mydocs

√ Default KitDocs Theme? (Y/n) · true

[kit-docs]: target directory is empty, creating new SvelteKit app.

PS D:\Github\lancer-docs>

Nothing happens, folder is empty.

@mihar-22
Copy link
Contributor

mihar-22 commented Apr 19, 2022

Ah this is a Windows specific bug. Tough to debug because I don't have a dev environment on a Windows machine. Best bet would be for you, or someone who has time to do the following and help me debug it:

  • git clone git@github.com:svelteness/kit-docs.git
  • cd kit-docs
  • pnpm i (install PNPM if you don't have it)
  • node ./packages/create-kit-docs/bin/create-kit-docs.js test (runs create package locally)

Next steps are more ambigious because we need to walk through the script (again at ./packages/create-kit-docs/bin/create-kit-docs.js) and figure out what's wrong. Probaby start here since it's where it stops.

@mihar-22 mihar-22 changed the title Boilerplate command does not scaffold an app npm init creates empty package on Windows Apr 19, 2022
@phenomen
Copy link
Author

phenomen commented Apr 19, 2022

Test run:

PS D:\Github\lancer> node ./packages/create-kit-docs/bin/create-kit-docs.js test

√ Default KitDocs Theme? (Y/n) · true

[kit-docs]: target directory is empty, creating new SvelteKit app.

[kit-docs]: failed to create new app.

Error: spawn npm ENOENT

Node: 17
pnpm: 6.32.3

@phenomen
Copy link
Author

Fixed it by adding shell: true to spawn

    try {
      const child = spawn('npm', ['init', 'svelte@next', rootDirName ?? '.'], {
        stdio: 'inherit',
        shell: true,
      });

@mihar-22
Copy link
Contributor

mihar-22 commented Apr 20, 2022

Thanks heaps @phenomen! Included in latest release.

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