Permissions Errors when installing PhantomJS

What I Wanted to Do

Trying to install phantomjs

What Happened Instead

Permissions errors:

Unhandled rejection Error: EACCES: permission denied, open '/home/bitnami/.npm/_cacache/index-v5/2e/2c/252674c972f0d72cf826fd3d61e862ab0e8d2ba9e8963fb24024568be141'

Unhandled rejection Error: EACCES: permission denied, open '/home/bitnami/.npm/_cacache/index-v5/c9/7b/a9508abcb1c3843b11071175e787cbb5c922d732e48d36340a7a8c81fed8'

Unhandled rejection Error: EACCES: permission denied, open '/home/bitnami/.npm/_cacache/index-v5/11/ca/af1f4120d96ca5a8ce95a96e27354151011b9101064398efa3cf74b205ae'

npm ERR! cb() never called!

Reproduction Steps

npm install phantomjs-prebuilt@2.1.13 --ignore-scripts

Details

2019-03-02T16_38_26_971Z-debug.log (14.0 KB)

Platform Info

$ npm --versions
{ sample: '0.0.1',
  npm: '6.8.0',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  napi: '3',
  nghttp2: '1.32.0',
  node: '8.11.3',
  openssl: '1.0.2o',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.19.1',
  v8: '6.2.414.54',
  zlib: '1.2.11' }

$ node -p process.platform
linux

Closing as a duplicate. See this post for a summarized guide: