Skip to content

deno install npm:simple-git-hooks --allow-scripts fails #28735

@felipecrs

Description

@felipecrs

Version: Deno 2.2.6

$ mkdir -p testproj

$ cd testproj

$ npm init -y

$ deno install -D npm:simple-git-hooks@2.12.1 --allow-scripts
Add npm:simple-git-hooks@2.12.1
error: script 'postinstall' in 'simple-git-hooks@2.12.1' failed with exit code 1
stderr:
error: Uncaught (in promise) Error: ENOENT: no such file or directory, stat '/tmp/tmp.mbqgWP7o55/node_modules/.deno/simple-git-hooks@2.12.1/package.json'
    at __node_internal_captureLargerStackTrace (ext:deno_node/internal/errors.ts:93:9)
    at __node_internal_uvException (ext:deno_node/internal/errors.ts:186:10)
    at denoErrorToNodeError (ext:deno_node/internal/errors.ts:1898:14)
    at Object.statSync (ext:deno_node/_fs/_fs_stat.ts:170:13)
    at _getPackageJson (file:///tmp/tmp.mbqgWP7o55/node_modules/.deno/simple-git-hooks@2.12.1/node_modules/simple-git-hooks/simple-git-hooks.js:205:13)
    at checkSimpleGitHooksInDependencies (file:///tmp/tmp.mbqgWP7o55/node_modules/.deno/simple-git-hooks@2.12.1/node_modules/simple-git-hooks/simple-git-hooks.js:128:34)
    at postinstall (file:///tmp/tmp.mbqgWP7o55/node_modules/.deno/simple-git-hooks@2.12.1/node_modules/simple-git-hooks/postinstall.js:14:9)
    at Object.<anonymous> (file:///tmp/tmp.mbqgWP7o55/node_modules/.deno/simple-git-hooks@2.12.1/node_modules/simple-git-hooks/postinstall.js:23:1)
    at Object.<anonymous> (file:///tmp/tmp.mbqgWP7o55/node_modules/.deno/simple-git-hooks@2.12.1/node_modules/simple-git-hooks/postinstall.js:25:4)
    at Module._compile (node:module:745:34)

error: failed to run scripts for packages: simple-git-hooks@2.12.1

This issue does NOT happen when using pnpm, so I'm reporting as a node compatibility issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions