Mapbox-gl-native: 403 error when installing Mapbox GL from npm

Created on 10 Nov 2019  路  1Comment  路  Source: mapbox/mapbox-gl-native

Platform: Node.js/Ubuntu
Mapbox SDK version: 5.0.2

Steps to trigger behavior

  1. Install Node v8.16.2/NPM v6.4.1 on Ubuntu;
    or Node v10.17.0/NPM v6.11.3 on Ubuntu;
    or Node v10.13.0/NPM v6.9.0 on Windows
    (all produce the same error)
  2. Run npm install @mapbox/mapbox-gl-native on a directory initialized with npm init

Expected behavior

Install would succeed without issues.

Actual behavior

Nasty error comes up. Binary file has a 403 error on S3 for some reason. Nothing seems to work and I don't know why it would be 403 in the first place. This error happens regardless if the package is installed from the GitHub release or npm.

```sh

@mapbox/[email protected] install /home/cyberscape/ccr/node_modules/@mapbox/mapbox-gl-native
node-pre-gyp install --fallback-to-build=false

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp ERR! install error
node-pre-gyp ERR! stack Error: 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/@mapbox/mapbox-gl-native/v5.0.2/node-v72-linux-x64-Release.tar.gz
node-pre-gyp ERR! stack at PassThrough. (/home/cyberscape/ccr/node_modules/node-pre-gyp/lib/install.js:137:27)
node-pre-gyp ERR! stack at PassThrough.emit (events.js:214:15)
node-pre-gyp ERR! stack at ClientRequest. (/home/cyberscape/ccr/node_modules/needle/lib/needle.js:482:9)
node-pre-gyp ERR! stack at Object.onceWrapper (events.js:297:20)
node-pre-gyp ERR! stack at ClientRequest.emit (events.js:209:13)
node-pre-gyp ERR! stack at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:582:27)
node-pre-gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:115:17)
node-pre-gyp ERR! stack at TLSSocket.socketOnData (_http_client.js:456:22)
node-pre-gyp ERR! stack at TLSSocket.emit (events.js:209:13)
node-pre-gyp ERR! stack at addChunk (_stream_readable.js:305:12)
node-pre-gyp ERR! System Linux 4.4.0-17134-Microsoft
node-pre-gyp ERR! command "/usr/bin/node" "/home/cyberscape/ccr/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build=false"
node-pre-gyp ERR! cwd /home/cyberscape/ccr/node_modules/@mapbox/mapbox-gl-native
node-pre-gyp ERR! node -v v12.9.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/@mapbox/mapbox-gl-native/v5.0.2/node-v72-linux-x64-Release.tar.gz

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @mapbox/[email protected] install: node-pre-gyp install --fallback-to-build=false
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @mapbox/[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! /home/cyberscape/.npm/_logs/2019-11-10T17_19_36_131Z-debug.log```

Most helpful comment

Nevermind, source of the problem was that Ubuntu was misbehaving. The install command was using Node v12 instead of Node v10. Switched to root via sudo bash, switched Node version via nvm use 10, and it works now.

Found this out through the 72 in the tarball URL, pointing to Node 12.x, which is the ABI number and how changing it to 64 resulted in a download rather than a 403 error.

>All comments

Nevermind, source of the problem was that Ubuntu was misbehaving. The install command was using Node v12 instead of Node v10. Switched to root via sudo bash, switched Node version via nvm use 10, and it works now.

Found this out through the 72 in the tarball URL, pointing to Node 12.x, which is the ABI number and how changing it to 64 resulted in a download rather than a 403 error.

Was this page helpful?
0 / 5 - 0 ratings