question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support PNPM and Others

See original GitHub issue

Note: If your feature-request is regarding the AWS Amplify Console service, please log it in the official AWS Amplify Console forum

Is your feature request related to a problem? Please describe.

I suppose you could consider this related to a problem; at present the Amplify CLI is forcing either npm or yarn upon the userbase. Locking users into a vendor is never a good idea. I work in a pnpm shop, and not being able to use that for install during push is not only putting us as a speed advantage, but it’s forcing us to use a codepath that we didn’t choose.

Describe the solution you’d like

I’d like first-class support for modifying the install command that’s used, or being able to skip the install step altogether, allowing the app’s amplify:{appName} script to prepare the directory for push. e.g. copying/moving node_modules into the target directory, or running our installer of choice.

Describe alternatives you’ve considered

There aren’t any. Woo!

Additional context

n/a

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
jayeclarkcommented, Jun 2, 2022

Oh hey @mikhael28 fancy seeing you here. 😆

First class support would be great, but (commenting here so it can help others if applicable) a workaround that seems to be fairly effective (it solved our deploy issues) is to edit the amplify.yml build file to use npx pnpm install for preBuild and npx pnpm build for build, instead of their yarn or npm counterparts.

1reaction
mikhael28commented, May 31, 2022

I’m going to say +1 to asking for first class support for pnpm. Meaning, in the Build Settings of the Amplify Console, support having pnpm install instead of npm or yarn. Frankly, this shouldn’t take too much work - whatever your base image is that runs all of these builds, just install pnpm as one of the initial dependencies. My open-source project just moved to pnpm (loving it, saving space/data from redownloading node_modules) and we are trying to build our app to keep our deployment pipeline going. We also changed to Vite at the same time, so that could be inviting some trouble as well.

Either way, we are going to be looking at migrating to another system ASAP for our CI pipeline - trying to use npm or yarn install in the Build settings successfully generates a build… but the hilarious thing is that the build is actually broken, even though Amplify puts it through. That’s a lack of testing on our part, but still - hilarious.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Only allow pnpm
When you use pnpm on a project, you don't want others to accidentally run.
Read more >
Tools | pnpm
Nx - Next generation build system with first class monorepo support and powerful integrations. Renovate - Automated dependency updates, for humans; syncpack ...
Read more >
Frequently Asked Questions - PNPM
Why does my node_modules folder use disk space if packages are stored in a global store?
Read more >
Workspace | pnpm
Luckily, pnpm supports the workspace: protocol. When this protocol is used, pnpm will refuse to resolve to anything other than a local workspace...
Read more >
pnpm add <pkg>
Supported package locations​ ... in a workspace, the command will first try to check whether other projects in the workspace use the specified...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found