Package that uses electron fails to install: trying to add file to /etc/service/watcher

Hiya. If I take a brand new Glitch project and add the following dependency in package.json:

"@stdlib/stdlib": "0.0.10"

npm fails:

> electron@1.7.5 postinstall /app/node_modules/electron
> node install.js
  throw err
Error: EACCES: permission denied, mkdir '/etc/service/watcher/electron-tmp-download-2195-1502586551864'

It looks like the electron postinstall is trying to write to /etc which isn’t allowed by Glitch.

Any hints as to a workaround? Should I complain to the electron people? Is there a way to tell npm to skip this postinstall? Maybe ask Glitch to allow things to be written to /etc/service/watcher?

npm install --ignore-scripts will fix this situation! (Hat tip:

1 Like

Doh, --ignore-scripts skips the postinstall but doesn’t actually install electron. If you really want to install electron, you’ll have to fix the underlying problem, which is because Glitch defines TMPDIR to /etc: export | grep etc returns a line, declare -x TMPDIR="/etc/service/watcher". Overwrite this, e.g., export TMPDIR=/tmp and run npm install :smile:!

Glitch admins, why is TMPDIR set inside /etc instead of /tmp?

It’s an npm thing (, they rely on you expressly setting it.