Skip to content

Instantly share code, notes, and snippets.

@cpsubrian
Created May 12, 2017 23:18
Show Gist options
  • Save cpsubrian/9b5dc69c5c5a90257fbe3f9ec6b0e399 to your computer and use it in GitHub Desktop.
Save cpsubrian/9b5dc69c5c5a90257fbe3f9ec6b0e399 to your computer and use it in GitHub Desktop.
Netlify Build Fails due to Private Dependencies
NPM_TOKEN=[your-npm-authentication-token]
YARN_VERSION=0.24.4
# If this file existed in the project root then `yarn install` will work as expected.
# The problem is this will break installs for environments where NPM_TOKEN is not set
# (i.e. your local machine). Thus, I'd like to create it before `yarn install` runs
# during the build process.
registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
2:50:21 PM: Build started
2:50:22 PM: Fetching cached dependencies
2:50:22 PM: Starting to download cache of 133.9MB
2:50:27 PM: Cache prepared
2:50:27 PM: Preparing Git Reference refs/heads/release
2:50:30 PM: Building site
2:50:30 PM: Running build command
2:50:32 PM: v6.10.3 is already installed.
2:50:33 PM: Using version v6.10.3 of node
2:50:33 PM: Using /opt/buildhome/.rvm/gems/ruby-2.1.2
2:50:33 PM: Found yarn version (0.18.1) that doesn't match expected (0.24.4)
2:50:34 PM: Installing yarn at version 0.24.4
2:50:34 PM: Installing Yarn!
2:50:34 PM: > Downloading tarball...
2:50:34 PM:
[1/2]: https://yarnpkg.com/downloads/0.24.4/yarn-v0.24.4.tar.gz --> /tmp/yarn.tar.gz.CfkAu2AkSf
% Total % Received % Xferd Average Speed
2:50:35 PM: Time Time Time Current
Dload Upload Total
2:50:35 PM:
2:50:35 PM: Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:-
2:50:35 PM: -:-- 0
2:50:35 PM: 100 92 100 92 0 0 968 0 --:--:-- --:--:-- --:--:-- 978
2:50:35 PM: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
2:50:35 PM: 0 0 0 595 0 0 2104 0 --:--:-- --:--:-- --:--:-- 4917
2:50:35 PM: 35 760k 35 271k 0 0 229k 0 0:00:03 0:00:01 0:00:02 229k
2:50:36 PM: 100 760k 100 760k 0 0 514k 0 0:00:01 0:00:01 --:--:-- 1669k
[2/2]: https://yarnpkg.com/downloads/0.24.4/yarn-v0.24.4.tar.gz.a
2:50:36 PM: sc --> /tmp/yarn.tar.gz.CfkAu2AkSf.asc
2:50:36 PM: 100 96 100 96 0 0 708 0 --:--:-- --:--:-- --:--:-- 708
2:50:36 PM: 0 0 0 600 0 0 2270 0 --:--:-- --:--:-- --:--:-- 2270
2:50:36 PM: 100 900 100 900 0 0 2592 0 --:--:-- --:--:-- --:--:-- 2592
2:50:36 PM: > Verifying integrity...
2:50:36 PM: gpg: Signature made Fri 12 May 2017 05:31:01 PM UTC using RSA key ID FD2497F5
2:50:36 PM: gpg: Good signature from "Yarn Packaging <[email protected]>"
2:50:36 PM: gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
2:50:36 PM: Subkey fingerprint: 6A01 0C51 6600 6599 AA17 F081 46C2 130D FD24 97F5
2:50:36 PM: > GPG signature looks good
2:50:37 PM: > Extracting to ~/.yarn...
2:50:37 PM: > Adding to $PATH...
2:50:37 PM: > We've added the following to your /opt/buildhome/.profile
2:50:37 PM: > If this isn't the profile of your current shell then please add the following to your correct profile:
export PATH="$HOME/.yarn/bin:$PATH"
2:50:37 PM: > Successfully installed Yarn 0.24.4! Please open another terminal where the `yarn` command will now be available.
2:50:37 PM: Installing NPM modules using Yarn version 0.24.4
2:50:38 PM: yarn install v0.24.4
2:50:38 PM: [1/4] Resolving packages...
2:50:39 PM: [2/4] Fetching packages...
2:50:40 PM: error An unexpected error occurred: "https://registry.npmjs.org/@terraeclipse/react-mapbox-gl/-/react-mapbox-gl-0.17.0.tgz: Request failed \"404 Not Found\"".
2:50:40 PM: info If you think this is a bug, please open a bug report with the information provided in "/opt/build/repo/yarn-error.log".
2:50:40 PM: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
2:50:40 PM: Error during Yarn install
2:50:40 PM: Cleaning up docker container
2:50:40 PM: Error running command: Build script returned non-zero exit code: 1
2:50:40 PM: Error running command: Build script returned non-zero exit code: 1
2:50:42 PM: Finished processing build request
{
"name": "has-private-deps",
"version": "1.0.0",
"dependencies": {
"@terraeclipse/mapbox-gl": "^0.23.0",
"@terraeclipse/react-mapbox-gl": "^0.17.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment