I’ve recently tried to use the build
property of the manifest.json
file which can execute a file when the plugin is published.
Unfortunately, when I try to publish the plugin I get the following error.
Build error: env: node: No such file or directory Path was: /usr/bin:/bin:/usr/sbin:/sbin
manifest.json
{
// ...
"build": "./bin/build"
}
bin/build
#! /usr/bin/env node
console.log("testing")
Upon further investigation, I can see that node gets installed by default under /usr/local/bin
. Also if you use any version managers it could be installed somewhere else completely.
From what I understand on a Mac /usr/bin
, /bin
, /usr/sbin
and /sbin
are all protected by System Integrity Protection. This restricts a user by default from making changes to these directories and it’s generally not advised to not to disable it. Generally, customisations should be made in /usr/local
.
I believe this is the reason why it is not working for me.
Does anyone have a suggestion to get around this issue?
Additionally, for Figma it would be great if Figma could look for the user’s $PATH
or at the least add usr/local/bin
as a directory to look in for executables.