Skip to content

postinstall script fails because it uses node (deno i --allow-scripts)Β #24916

@alexgleason

Description

@alexgleason

Version: Deno 1.45.5

I am trying to make vitepress (with a package.json) build with Deno using:

DENO_FUTURE=1 deno i --allow-scripts
deno task build

It results in this error:

Error launching 'node': No such file or directory (os error 2)
error: script 'postinstall' in '[email protected]' failed with exit code 1
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1

The problem is that node is used as an executable inside of the postinstall script of the package:

"postinstall": "node -e \"try{require('./scripts/postinstall.js')}catch(e){}\"",

I submitted an MR to vue-demi to skip the postinstall script if node is not found, because it not essential: vueuse/vue-demi#266

I'm not sure if that's the solution, or if we want to make it use the deno executable there. It would improve compatibility.

I was also able to work around it by using --allow-scripts=npm:esbuild to whitelist the only other package with a postinstall script, but it would be frustrating if there was a lot of other packages and no way to blacklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions