If you are having download Chromium issue while installing puppeteer, gsts and similar node packages, Heres how you can solve this.

NPM Problem Trace

npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
/usr/local/bin/gsts -> /usr/local/lib/node_modules/gsts/index.js


> [email protected] install /usr/local/lib/node_modules/gsts/node_modules/puppeteer
> node install.js


ERROR: Failed to download Chromium r722234! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/gsts/node_modules/puppeteer/.local-chromium'
  -- ASYNC --
    at BrowserFetcher.<anonymous> (/usr/local/lib/node_modules/gsts/node_modules/puppeteer/lib/helper.js:111:15)
    at Object.<anonymous> (/usr/local/lib/node_modules/gsts/node_modules/puppeteer/install.js:66:16)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path:
   '/usr/local/lib/node_modules/gsts/node_modules/puppeteer/.local-chromium' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/myname/.npm/_logs/2020-09-09T08_07_14_706Z-debug.log


The Fix

The Fix is pretty easy, just add --unsafe-perm=true --allow-root in your command like the code snippet. it should work