Jump to content
GreenSock

Dean Draper

What is the simplest way to deploy to Vercel when I'm using Club Greensock?

Moderator Tag
Go to solution Solved by Rodrigo,

Recommended Posts

I am attempting to deploy to Vercel with Club Greensock packages, and I am receiving the following error:
[13:52:29.305] Running build in Cleveland, USA (East) – cle1
[13:52:29.368] Cloning github.com/dwaynedraper/bed-and-barkfest (Branch: master, Commit: f46ce8d)
[13:52:31.871] Cloning completed: 2.503s
[13:52:33.115] Restored build cache
[13:52:33.146] Running "vercel build"
[13:52:33.652] Vercel CLI 29.3.6
[13:52:33.906] Installing dependencies...
[13:52:35.952] npm ERR! code E403
[13:52:35.954] npm ERR! 403 403 Forbidden - GET https://npm.greensock.com/@gsap%2fshockingly/-/shockingly-3.11.5.tgz - bad authorization header. Please login again
[13:52:35.954] npm ERR! 403 In most cases, you or one of your dependencies are requesting
[13:52:35.954] npm ERR! 403 a package version that is forbidden by your security policy, or
[13:52:35.954] npm ERR! 403 on a server you do not have access to.
[13:52:35.954] 
[13:52:35.954] npm ERR! A complete log of this run can be found in:
[13:52:35.955] npm ERR!     /vercel/.npm/_logs/2023-05-29T18_52_34_276Z-debug-0.log
[13:52:35.972] Error: Command "npm install" exited with 1
[13:52:36.114] BUILD_UTILS_SPAWN_1: Command "npm install" exited with 1


I have added my NPM_TOKEN to vercel. What else do I need to do?

Link to comment
Share on other sites

  • Solution

Hi,

 

Be sure to have something like this in your .npmrc file:

always-auth=true
@gsap:registry=https://npm.greensock.com
//npm.greensock.com/:_authToken=${NPM_TOKEN}

This repo was deployed less than two weeks ago to vercel without any issues:

https://github.com/rhernandog/gsap-bonus-npm-vercel

 

Here is the live page (not a lot, just a proof of concept of a successful deployment and CI/CD pipeline):

https://gsap-bonus-npm-vercel.vercel.app/

 

If you inspect the console you'll find this line there:

https://github.com/rhernandog/gsap-bonus-npm-vercel/blob/main/pages/_app.js#L8

 

Hopefully this helps.

Happy Tweening!

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Oh wow, that's so much simpler than anything I was trying to do. I changed my .npmrc to that and added my Greensock Club token as NPM_TOKEN at the env var section of Vercel, and that's that. Thank you so much!

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×