4 ms·
You can find out which packages require postinstall scripts and then run them manually: $ grep postinstall node_modules/*/package.json node_modules/esbuild
by notpublic 5y ago
You can find out which packages require postinstall scripts and then run them manually:
$ grep postinstall node_modules/*/package.json
node_modules/esbuild/package.json: "postinstall": "node install.js"
$ cd node_modules/esbuild
$ npm run postinstall
- inbx0 5y agoAnd to clarify, you should run this once by hand to collect the list, don't add the grepping to the actuall installation script or you are back to square one :D Here's what I use with yarn, install.sh: #!/usr/bin/env bash yarn function run_install() { local dependency="node_modules/$1" if [[ -d "$dependency" ]]; then yarn --cwd "$dependency" run postinstall fi } run_install 'esbuild' run_install 'other_package' ...
- notpublic 5y agoGood point and nice script. I am going to use it in my projects. I wish package.json had an option where I could explicitly mark which packages can run postinstall scripts.
- dustyharddrive 5y ago> explicitly mark which packages can run postinstall scripts Here's an RFC on exactly that: https://github.com/npm/rfcs/discussions/80 https://github.com/npm/rfcs/discussions/80