obsidian-dev-utils icon indicating copy to clipboard operation
obsidian-dev-utils copied to clipboard

[BUG] postinstall.sh script error when installing globally

Open xlvnacyx opened this issue 1 month ago • 2 comments

Description

Installing per project is fine, but if I attempt to install this package globally, ie

npm i -g obsidian-dev-utils

this error arises:

npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm error code 254
npm error path /home/vscode/.volta/tmp/image/packages/.tmpzKuZn9/lib/node_modules/obsidian-dev-utils/node_modules/obsidian-typings
npm error command failed
npm error command sh -c npx bun run scripts/postinstall.ts
npm error npm warn exec The following package was not found and will be installed: [email protected]
npm error npm error code ENOENT
npm error npm error syscall open
npm error npm error path /home/vscode/.npm/_npx/5c4f1b4a21be27f7/package.json
npm error npm error errno -2
npm error npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/home/vscode/.npm/_npx/5c4f1b4a21be27f7/package.json'
npm error npm error enoent This is related to npm not being able to find a file.
npm error npm error enoent
npm error npm error A complete log of this run can be found in: /home/vscode/.npm/_logs/2025-11-27T18_02_29_077Z-debug-0.log
npm error A complete log of this run can be found in: /home/vscode/.npm/_logs/2025-11-27T18_01_31_599Z-debug-0.log

I pulled up the log mentioned in the error message, and it appears obsidian-typings remains the culprit, though I could be wrong. This is the stack trace for the error that gets spit out before npm prints the error above:

9130 info run [email protected] postinstall { code: 254, signal: null }
9131 verbose stack Error: command failed
9131 verbose stack     at promiseSpawn (/home/vscode/.volta/tools/image/npm/11.6.2/node_modules/@npmcli/promise-spawn/lib/index.js:22:22)
9131 verbose stack     at spawnWithShell (/home/vscode/.volta/tools/image/npm/11.6.2/node_modules/@npmcli/promise-spawn/lib/index.js:124:10)
9131 verbose stack     at promiseSpawn (/home/vscode/.volta/tools/image/npm/11.6.2/node_modules/@npmcli/promise-spawn/lib/index.js:12:12)
9131 verbose stack     at runScriptPkg (/home/vscode/.volta/tools/image/npm/11.6.2/node_modules/@npmcli/run-script/lib/run-script-pkg.js:79:13)
9131 verbose stack     at runScript (/home/vscode/.volta/tools/image/npm/11.6.2/node_modules/@npmcli/run-script/lib/run-script.js:9:12)
9131 verbose stack     at /home/vscode/.volta/tools/image/npm/11.6.2/node_modules/@npmcli/arborist/lib/arborist/rebuild.js:332:17
9131 verbose stack     at run (/home/vscode/.volta/tools/image/npm/11.6.2/node_modules/promise-call-limit/dist/commonjs/index.js:67:22)
9131 verbose stack     at /home/vscode/.volta/tools/image/npm/11.6.2/node_modules/promise-call-limit/dist/commonjs/index.js:84:9
9131 verbose stack     at new Promise (<anonymous>)
9131 verbose stack     at callLimit (/home/vscode/.volta/tools/image/npm/11.6.2/node_modules/promise-call-limit/dist/commonjs/index.js:35:69)
9132 verbose pkgid [email protected]
9133 error code 254
9134 error path /home/vscode/.volta/tmp/image/packages/.tmpzKuZn9/lib/node_modules/obsidian-dev-utils/node_modules/obsidian-typings
9135 error command failed

obsidian-typings seems to be an obstruction in a number of tools designed to improve the Obsidian plugin developer experience. Not sure how I can help but I'm open to ideas.

Steps to Reproduce

  1. Run npm i -g obsidian-dev-utils

I have tried running this on different flavors of Ubuntu and Debian, as I work from linux containers and virtual machines for development. Same issue across all bases.

Expected Behavior

I expected the package to install globally without issue.

Actual Behavior

An error arises where a post-install script attempts to install bun and fails.

Environment Information

  • obsidian-dev-utils Version: v44.2.1
  • Operating System: Debian 12, Debian 13, Ubuntu 20, Ubuntu 22

Attachments

I've attached all relevant information above (log snippets) that I can think of.

Confirmations

  • [x] I attached a video showing the bug, or it is not necessary
  • [x] I have tested the bug with the latest version of the utils
  • [x] I have checked GitHub for existing bugs

xlvnacyx avatar Nov 27 '25 20:11 xlvnacyx

Why would you want to install obsidian-dev-utils globally? What's the usecase?

mnaoumov avatar Nov 27 '25 20:11 mnaoumov

Bootstrapping a container with tooling specific to Obsidian plugin development.

xlvnacyx avatar Nov 30 '25 20:11 xlvnacyx