Skip to content

Commit 2ea81cc

Browse files
dorlugasigalCopilot
andcommitted
fix: use require.resolve to find hoisted node-pty in postinstall
When installed via npx, node-pty is hoisted as a sibling of termbeam (not nested inside termbeam/node_modules/). The previous postinstall used __dirname + 'node_modules/node-pty' which missed the hoisted location. Use require.resolve('node-pty/package.json') to find node-pty regardless of hoisting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 370e325 commit 2ea81cc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"format": "prettier --write .",
1616
"lint": "node --check src/*.js bin/*.js",
1717
"prepublishOnly": "npm test",
18-
"postinstall": "node -e \"try{const p=require('path'),fs=require('fs'),d=p.join(__dirname,'node_modules','node-pty','prebuilds');if(fs.existsSync(d)){for(const a of fs.readdirSync(d)){const s=p.join(d,a,'spawn-helper');try{fs.chmodSync(s,0o755)}catch{}}}}catch{}\""
18+
"postinstall": "node -e \"try{const p=require('path'),fs=require('fs'),r=require.resolve('node-pty/package.json'),d=p.join(p.dirname(r),'prebuilds');if(fs.existsSync(d)){for(const a of fs.readdirSync(d)){const s=p.join(d,a,'spawn-helper');try{fs.chmodSync(s,0o755)}catch{}}}}catch{}\""
1919
},
2020
"keywords": [
2121
"terminal",

0 commit comments

Comments
 (0)