






























Hey, me again 😬
Today I had something weird happen: I cleared my yay cache, and the agent-browser binary stopped working. I did some digging and found that apparently the upstream package has a script that does some changes on the symlink to the binary. In the case of the AUR package, this ends up causing the binary to point to the package source instead of the actual installed path.
Not sure if this is something that's happening to everyone, but if the following change doesn't break your installation, I think it's worth applying to avoid having this weird behavior in the future.
The idea is to disable the postinstall script alltogether and make the binary executable (the postinstall does that too), changing lines 16-20 to:
/usr/bin/npm install -g --ignore-scripts --cache "${srcdir}/npm-cache" --prefix "${pkgdir}/usr" "${srcdir}/${pkgname}-${pkgver}.tgz"
# Fix permissions
find "${pkgdir}/usr" -type d -exec chmod 755 {} +
chmod 755 "${pkgdir}/usr/lib/node_modules/${pkgname}"/bin/agent-browser-*
Seems to be working now, thanks for the changes!
Thanks for the info, I have updated the package with your suggestions please check and let me know if this works better for you?
Hmm, are you using asdf or other such version Managers that change the path and add the version of npm or node from location other than default nodejs installation using pacman which I think is /usr/bin Without this the build fails for me because it picks up older version that's required for another project because asdf adds its path to the beginning. If you have a suggestion I'm open to ideas but I thought rather than removing asdf from path it's better to have system binary before and if it doesn't exist then pick whichever else it finds.
This change broke the installation for me, I don't know about everyone else:
export PATH="/usr/bin:$PATH"
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。
Hi asermax, thanks for the suggestion! I've applied your --ignore-scripts approach in 0.25.3-1.
Previously I was fixing the broken symlinks after npm install by finding all symlinks in /usr/bin that pointed into $pkgdir and rewriting them as relative paths with ln -sfr. Your approach is cleaner — skipping the postinstall entirely prevents the problem at the source rather than patching it after. The postinstall script was creating absolute symlinks to the platform-specific binary (e.g. agent-browser-linux-x64), which baked in the build directory path. With --ignore-scripts, npm creates a proper relative symlink to agent-browser.js instead.
Confirmed working:
Also updated to 0.25.3 while at it.