New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@babel/register crashes when node_modules/.cache folder is not writable #6906

Open
feross opened this Issue Nov 25, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@feross

feross commented Nov 25, 2017

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
@babel-bot

This comment has been minimized.

Show comment
Hide comment
@babel-bot

babel-bot Nov 25, 2017

Collaborator

Hey @feross! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

Collaborator

babel-bot commented Nov 25, 2017

Hey @feross! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@hzoo hzoo added the i: bug label Nov 25, 2017

@hzoo

This comment has been minimized.

Show comment
Hide comment
@hzoo

hzoo Dec 1, 2017

Member

Thanks for the report! Just as fyi, workaround is use process.env.BABEL_DISABLE_CACHE or set the BABEL_CACHE_PATH

Member

hzoo commented Dec 1, 2017

Thanks for the report! Just as fyi, workaround is use process.env.BABEL_DISABLE_CACHE or set the BABEL_CACHE_PATH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment