Skip to content

bug: npm init stencil fails with error code 1 on Windows #618

@khaledsAlshibani

Description

@khaledsAlshibani

Prerequisites

Stencil Version

latest (4.29)

Current Behavior

Running the following command fails on Windows:

npm init stencil

After selecting component starter template, the CLI throws an error:

npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c create-stencil
npm ERR! code 1

Expected Behavior

The project should scaffold correctly after selecting a starter template when running npm init stencil.

Workaround:
Using npx create-stencil@latest works as expected and successfully scaffolds the project.

System Info

**npm**: 10.8.2
**node**: v20.11.0
**OS**: Windows 11

Steps to Reproduce

  1. Run npm init stencil on Windows (PowerShell or CMD).
  2. Choose component starter template.
  3. Observe the error after selection.

Additional Information

  • Tried running it using powershell, cmd, and git bash.
  • I tried using a clean/empty project directory.
  • Internet connection is fine, npx create-stencil@latest worked.
  • Seems like create-stencil script is not resolving correctly when invoked via npm init.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: ValidatedThis PR or Issue is verified to be a bug within create-stencilHelp Wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions