-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
Bug report.
@babel/register crashes when the node_modules/.cache folder is not writable. This can happen if the node process is running as a different user than the user who owns the node_modules folder.
Babel Register Configuration
The specifics of my config are not relevant to this issue, but here it is anyway.
babelRegister({
only: [/views/, /lib/],
extensions: ['.js', '.mjs']
})Expected Behavior
I noticed that @std/esm also uses the node_modules/.cache folder, but it recovers gracefully when this folder is not writable, probably falling back to another folder or simply disabling the cache. This seems like much better behavior than crashing the process.
Current Behavior
The process crashes when node_modules/.cache is not writable.
Context
I run my production Node.js process as the www-data user, which does not have permission to write to the app folder, including the node_modules folder. Therefore, @babel/register is unable to write into the node_modules/.cache folder.
Your Environment
| software | version(s) |
|---|---|
| Babel | @babel/core@7.0.0-beta.32 |
| Babel-register | @babel/register@7.0.0-beta.32 |
| Babylon | |
| node | 8.9.0 |
| npm | 5.5.1 |
| Operating System | macOS 10.13.1 |