egoist / esbuild-register

Transpile JSX, TypeScript and esnext features on the fly with esbuild
MIT License
984 stars 52 forks source link

Error: EACCES: permission denied, scandir '/home' #102

Open amityweb opened 5 months ago

amityweb commented 5 months ago

I am using Strapi CMS. Its under a specific user on my server, so Node and NPM are all installed in the user home directory.

I am not personally including esbuild-register, I assume it's bundled with Strapi or another package.

When I run npm run build (to build the Strapi admin interface) I get the following error. I assume its because esbuild-register is trying to scan the main server /home directory for some reason, and of course my user would not have permissions for that.

Why would it need to scan /home? Or is that a mistake and should in fact be the user home $HOME, or ~ or something?

Thanks

> strapi@4.16.2 build
> strapi build

⠋ Building build context
[INFO] Including the following ENV variables as part of the JS bundle:
    - ADMIN_PATH
    - STRAPI_ADMIN_BACKEND_URL
    - STRAPI_TELEMETRY_DISABLED
[ERROR]  There seems to be an unexpected error, try again with --debug for more information 

│   Error: EACCES: permission denied, scandir '/home'                                                                     │
│       at readdirSync (node:fs:1525:3)                                                                                   │
│       at walkForTsConfig (/home/my-cms/webapps/my-cms/node_modules/esbuild-register/dist/node.js:4168:17)     │
│       at walkForTsConfig (/home/my-cms/webapps/my-cms/node_modules/esbuild-register/dist/node.js:4180:12)     │
│       at walkForTsConfig (/home/my-cms/webapps/my-cms/node_modules/esbuild-register/dist/node.js:4180:12)     │
│       at walkForTsConfig (/home/my-cms/webapps/my-cms/node_modules/esbuild-register/dist/node.js:4180:12)     │
│       at resolveConfigPath (/home/my-cms/webapps/my-cms/node_modules/esbuild-register/dist/node.js:4161:30)   │
│       at loadSyncDefault (/home/my-cms/webapps/my-cms/node_modules/esbuild-register/dist/node.js:4138:22)     │
│       at tsConfigLoader (/home/my-cms/webapps/my-cms/node_modules/esbuild-register/dist/node.js:4133:22)      │
│       at configLoader (/home/my-cms/webapps/my-cms/node_modules/esbuild-register/dist/node.js:4270:22)        │
│       at loadConfig2 (/home/my-cms/webapps/my-cms/node_modules/esbuild-register/dist/node.js:4253:12)         │