Skip to content

🐛 Knip fails to run in official Stackblitz templates #1316

@TrevorBurnham

Description

@TrevorBurnham

Prerequisites

Reproduction url

https://stackblitz.com/github/webpro-nl/knip/tree/main/templates/issue-reproduction/basic

Reproduction access

  • I've made sure the reproduction is publicly accessible

Description of the issue

I wanted to reproduce another bug, but when I follow either of the Stackblitz links from https://knip.dev/guides/issue-reproduction#templates and run npx knip in the terminal, I get this error:

Error: Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
    at Object.eval (/home/projects/aoniqgqqkq.github/node_modules/oxc-resolver/index.js:570:11)
    at Object._0xf5cb4c (https://aoniqgqqkqgithub-2ozt-8vij1i0f.w-credentialless-staticblitz.com/blitz.1db57326.js:31:866229)
    at Module._compile (node:internal/modules/cjs/loader:148:16006)
    at Module._extensions..js (node:internal/modules/cjs/loader:148:16726)
    at Module.load (node:internal/modules/cjs/loader:148:15281)
    at Module._load (node:internal/modules/cjs/loader:148:12773)
    at G.set.n (node:internal/modules/esm/translators:163:4437)
    at _0x3aa65c.evaluationFunction (node:internal/modules/esm/translators:163:3218)
    at _0x3aa65c.evaluate (https://aoniqgqqkqgithub-2ozt-8vij1i0f.w-credentialless-staticblitz.com/blitz.1db57326.js:31:832001)
    at _0x59aa5d._evaluate (https://aoniqgqqkqgithub-2ozt-8vij1i0f.w-credentialless-staticblitz.com/blitz.1db57326.js:31:839316)

Node.js v20.19.1

I see the same error after removing package-lock.json and node_modules and re-running npm install as the error message advises.

I'm running Stackblitz in Chrome 141 on macOS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions