Nodejs tarball dependency not cached error

I am unable to use snapcraft when Node.JS’s package.json contains dependencies with full URL to a tarball.

npm ERR! code ENOTCACHED
npm ERR! request to https://github.com/Z3TA/node-ftp/tarball/master failed: cache mode is ‘only-if-cached’ but no cached response available.

Running npm install --offline --prod however works in --debug