Jump to content
Search Community

Prasanna

Members
  • Posts

    61
  • Joined

  • Last visited

Everything posted by Prasanna

  1. Yeah, you might wanna delete the node_modules directory before trying again.
  2. If you setup the auth-token properly the installation seems to work fine. You could find detailed instruction here which works with the private registry:
  3. Hey @Yellow Car, this is what's going on when you execute each commands: $ npm config set @gsap:registry https://npm.greensock.com/ ^ This command adds the following entry to the ~/.npmrc file: @gsap:registry=https://npm.greensock.com $ npm config set //npm.greensock.com/:_authToken <your-auth-token> ^ Just like the previous this command adds the following entry to the ~/.npmrc file: //npm.greensock.com/:_authToken=<your-auth-token> You might notice that the above entries are the exact lines specified in the Greensock installation docs. But sometimes, manual errors might cause some issues while entering data into the .npmrc file like adding/missing an extra space/character. These commands just prevents the same from happening. $ npm install @gsap/business ^ This command is required to fill the npm cache in npm v7. I'ts a weird bug introduced in the npm v7 that causes installation failures while using package name aliases $ npm install gsap@npm:@gsap/business Finally, this is the command that installs the package "@gsap/business" and gives it an alias name "gsap". As a result, you can import code from the business package like all other regular greensock packages: import GSAP from 'gsap' - this will import code from @gsap/business package in our case Pretty cool huh?
  4. Can you try doing this: Delete the .npmrc file in the project then run the following commands (don't forget to replace the <your-auth-token> with the correct token $ npm config set @gsap:registry https://npm.greensock.com/ $ npm config set //npm.greensock.com/:_authToken <your-auth-token> $ npm install @gsap/business $ npm install gsap@npm:@gsap/business This should solve the issues Let me know if it still doesn't work
  5. The config seems to be fine on your local machine. But to deploy to netlify you need to use environment variables. Here's a detailed guide how you can do the same: https://answers.netlify.com/t/support-guide-using-private-npm-modules-on-netlify/795 (Apologies for the delay in my response. I forgot to hit the submit button ?‍♂️)
  6. Could you share the .npmrc file (without the token)?
  7. UPDATE: This issue seems to have been solved in yarn berry. Here's how you could use it the package in yarn berry: Create a .yarnrc.yml file in your project root and add the following: nodeLinker: node-modules npmScopes: gsap: npmRegistryServer: "https://npm.greensock.com" npmAlwaysAuth: true npmRegistries: //npm.greensock.com: npmAlwaysAuth: true npmAuthToken: "<your-token-here>" Then run the following commands in the terminal: $ yarn set version berry $ yarn add gsap@npm:@gsap/shockingly@* You might have to delete the existing yarn.lock file to support yarn berry.
  8. There seems to be a problem with yarn and package aliases (More info here: https://github.com/yarnpkg/yarn/issues/8584) So, if you really need to deploy with yarn to netlify/vercel then you need to try either of these workarounds: 1. Delete yarn.lock file from the project and deploy or 2. add registry=https://npm.greensock.com/ to the npmrc file of the project. Note that this will fetch all packages from greensock private registry. or 3. Do not use package name alias. Install the package using `$ yarn add @gsap/shockingly` and use it as `import gsap from `@gsap/shockingly` Feel free to comment on the above github issue so that the maintainers of yarn releases a bugfix soon.
  9. Well, that's very unlikely to happen. Following these steps always provide with successful installations: 1. Delete yarn.lock file from the project 2. Create .npmrc file in the project's root directory and add the following lines: //npm.greensock.com/:_authToken=${NPM_TOKEN} @gsap:registry=https://npm.greensock.com/ 3. Ensure that the package.json file does not contain `gsap` under dependencies/devDependencies 4. Run: $ yarn add gsap@npm:@gsap/shockingly 5. Push the code - if the ENV variables on netlify are configured properly, the installation should be good.
  10. You might wanna add a .yarnrc in your project that you're deploying to netlify. If that doesn't work could you share the yarn version that you're using on Netlify & the error message?
  11. $ npm install gsap@npm:@gsap/shockingly@latest should solve this
×
×
  • Create New...