Skip to content

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

Closed
@felipecrs

Description

@felipecrs

Version: Deno 2.2.6

$ mkdir -p testproj

$ cd testproj

$ npm init -y

$ deno install -D npm:[email protected] --allow-scripts
Add npm:[email protected]
error: script 'postinstall' in '[email protected]' failed with exit code 1
stderr:
error: Uncaught (in promise) Error: ENOENT: no such file or directory, stat '/tmp/tmp.mbqgWP7o55/node_modules/.deno/[email protected]/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/[email protected]/node_modules/simple-git-hooks/simple-git-hooks.js:205:13)
    at checkSimpleGitHooksInDependencies (file:///tmp/tmp.mbqgWP7o55/node_modules/.deno/[email protected]/node_modules/simple-git-hooks/simple-git-hooks.js:128:34)
    at postinstall (file:///tmp/tmp.mbqgWP7o55/node_modules/.deno/[email protected]/node_modules/simple-git-hooks/postinstall.js:14:9)
    at Object.<anonymous> (file:///tmp/tmp.mbqgWP7o55/node_modules/.deno/[email protected]/node_modules/simple-git-hooks/postinstall.js:23:1)
    at Object.<anonymous> (file:///tmp/tmp.mbqgWP7o55/node_modules/.deno/[email protected]/node_modules/simple-git-hooks/postinstall.js:25:4)
    at Module._compile (node:module:745:34)

error: failed to run scripts for packages: [email protected]

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