Jump to content
Search Community

Trouble installing npm install gsap@npm:@gsap/shockingly

Mauro.ie31 test
Moderator Tag

Go to solution Solved by Mauro.ie31,

Recommended Posts

Hi there,

I created the .npmrc file in my root project.
After I upgrade to nodejs v. 14 and reinstalled my pacjage I ave trouble to install gsap/shockingly:

I get this error:

 

npm ERR! code E403
npm ERR! 403 403 Forbidden - GET https://npm.greensock.com/@gsap%2fshockingly/-/shockingly-3.6.0.tgz - You must be logged in to install/publish packages.
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\me\AppData\Local\npm-cache\_logs\2021-02-25T11_44_49_017Z-debug.log

Link to comment
Share on other sites

  • Solution
33 minutes ago, ZachSaucier said:

@tailbreezy The post that you referenced is talking about Yarn, not NPM. 

 

@Mauro.ie31 It's pretty hard to know what's going wrong without seeing your setup for ourselves. Something is messed up in the configuration. Have you already tried reinstalling by following the private registry NPM instructions on your account dashboard?

I actually solved by using npm instal gsap.bonus.tgz.

It's actually pretty hard to know. I try to delete my package json and install the packages from beginning.

I don't know. Hope it doesn't happen again :)

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

I've got a similar problem.

I followed the instructions for installing from the private npm registry and it works fine as long as i work on my machine.

But when deploying onto the server the installation process fails with the same authentication error as @Mauro.ie31 printed at the top.

 

Any idea how to resolve this? The hosting provider is platform.sh.

 

Thanks!

Link to comment
Share on other sites

Chipping in with the same issue.
I've gotten the arm64 and thus running node 15 and NPM 7.6.3
But no luck installing gsap @ shockingly member with npm 7.x.x.
 

variations I've tried

- specifying @^3.6.0, @latest, and nothing :)

- deleted package-lock
- --peer-legacy-deps (even though it has no relevance in reality but I was desperate)..
- adding the new line for registry as if its yarn in npmrc, even though its npm.


Always getting the same:
 

npm ERR! code E403
npm ERR! 403 403 Forbidden - GET https://npm.greensock.com/@gsap%2fshockingly/-/shockingly-3.6.0.tgz - You must be logged in to install/publish packages.
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.

 

Now, it WORKS on npm 6.xx which I have installed on my other 2 working stations as I've been developing on this project for last 4 months.

 

It seems its something to do with NPM 7xx ? or 7.6.3.
I have to solve this issue today as I need to develop on this laptop remotely - got a deadline.
I'll try to test different npm's within limits to node and arm64 arch

Update:

Found NPM Open issues regarding private registry and 7.3.6 version:
https://github.com/npm/cli/issues/2508

And another closed where supposedly they fixed it from 7.3+ but some working versions are mentioned which ill try soon
https://github.com/npm/cli/issues/2183

  • Like 2
Link to comment
Share on other sites

Thanks for the info, @vsimak. The issue seems to be an ongoing problem with NPM v7. A bug report has already been filed and we're awaiting their response. Until then the only workaround we have found so far is running two install commands while on npm v7:

npm install @gsap/shockingly
npm install gsap@npm:@gsap/shockingly

The reason why we need two install commands is because the first command inserts the correct package into the npm cache. So the next command will be able to retrieve the package directly from the npm cache.

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

  • 3 weeks later...

Hi and welcome,

 

I just purchased and had the same issue and the fix was VERY easy for me:

registry=https://npm.greensock.com


This little piece of information is missing in the setup instructions and I just found it here at the forums.
As you can see in my attachment, the content only contains the "comment" and the @gsap:registry line but I also had to write down the first line as written at the beginning. After that, my issue E403 was gone and it installed perfectly.

Maybe its worth adding this line to the setup instructions. Wasn't a smooth start so far :D  (while everything else is very smooth, been using ScrollTrigger for a while now and I love it)

P.S: Copy to clipboard button is not working (MacOS, Chrome 89, Big Sur 11.2.3)

 

Bildschirmfoto 2021-04-13 um 00.27.57.png

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

@Jamesh be careful. This will set the NPM Registry completely to the one that GreenSock provided. I also encountered this and all my packages suddenly had been couple of months old. (Webpack 5.3.x dropped to 5.1 or something) because the provided registry does not update as fast as the main. I ended up removing that line I've suggested after the installation and everything worked out fine so far.

  • Like 1
Link to comment
Share on other sites

@Hirbod  Thank you for kindly making further comment. Just to clarify you have removed 

registry=https://npm.greensock.com

 

from the .npmrc file? And that everything works fine once this has been removed?  I’m using this locally but will be deploying to Netlify so hoping it won’t throw up any errors! 

Link to comment
Share on other sites

Yes, I have removed that line because it has messed up all my other packages (after install). But I had that line added globally before and ended up creating a local one after the setup and everything seems to work fine now (since the GreenSock Registry is cached somehow).

I will have to check if I still receive updates though.

Link to comment
Share on other sites

  • 4 months later...

For anyone deploying to AWS Amplify that is running into the 403 Forbidden issue, we managed to get the package installs working nicely by adding the following to our amplify.yml file.

Note that we tried the yarn equivalents initially, however only had luck using npm.

 

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - npm config set //npm.greensock.com/:_authToken your-secret-token-goes-here
        - npm config set @gsap:registry https://npm.greensock.com
        - npm install gsap@npm:@gsap/shockingly
        - npm config delete //npm.greensock.com/:_authToken
        - npm config delete @gsap:registry
        - yarn install
    build:
# the rest of your amplify build stuff under here...

Hope this can help someone running into the same issue!

Also, we would be keen to hear of any other solutions people have come across.

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

  • 8 months later...

Thank you @pxel I managed to create my Dockerfile for my NextJS app following your suggestion.

 

In case anyone needs it here is a basic version based on the official NextJS with docker example:

# Stage 1: Copy source code and build nextjs app
FROM node:16 as builder

WORKDIR /usr/src/app
COPY ./package.json ./
COPY ./package-lock.json ./
RUN npm config set //npm.greensock.com/:_authToken=yourverylongauthtocken123456789
RUN npm config set @gsap:registry https://npm.greensock.com
RUN npm install @gsap/shockingly
RUN npm install gsap --registry https://npm.greensock.com
RUN npm config delete //npm.greensock.com/:_authToken
RUN npm config delete @gsap:registry
RUN npm install
COPY . .
RUN npm run build

# Stage 2: copy production code and execute entrypoint script
FROM node:16

WORKDIR /usr/src/app
COPY ./package.json ./
COPY ./package-lock.json ./

# Copy build files and entrypoint scripts
COPY --from=builder /usr/src/app .

# Install production dependencies
RUN npm install --production

EXPOSE 3000

RUN npm run start

 

  • Thanks 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.
×
×
  • Create New...