-
Notifications
You must be signed in to change notification settings - Fork 248
While running as root .gz files gets created on working directory #545
Comments
The thing is: we don't use tmpdir() or TMPDIR in our codebase. So not sure if we should handle this. Asking for something during the setup might seems overkill (for most use case). Can you check if disabling babel cacheDirectory fix this problem? It seems it might be the culprit (in this case we can specify a specific folder - so fix this issue ourself). |
Setting cache_directory to false on webpack,config.babel.js did solve the problem. |
I sent a PR to create-react-app to fix this issue here facebook/create-react-app#620 Poke @MoOx should I do the same here? |
I have a local wip but it uses Jest. Waiting on #744 |
babel-loader now handle this. |
When running phenomic as root a bunch of .gz files intended for cache get's created on the working directory.
This is caused by the os.tmpdir() and process.env.TMPDIR pointing to the working dir and not /tmp/ as expected. This is similar to this webpack issue and caused by the same reasons
On this issue from npm it says it is related to this line on npm and relates the switch to this npm configuration.
So running trhough npm as root changes the tmp dir.
So for example this script:
As root (either locally or on container):
On container directly as root (node script.js):
running locally directly (non root):
locally trhough npm gives (non root):
I realize this is the expected behaviour by NPM folks but is a pretty specific caveat and one that will always happen on docker.
I suggest either asking for the tmp directory on the setup script and configuring unsafe-perm or the env var , or put a warning on the script before start if tmp dir is equal to working dir , or even a simple warning somewhere on the site to people be aware of the caveat.
The text was updated successfully, but these errors were encountered: