0

I'm working on a NextJS application which is deployed through Clever Clouds.

One of the newer dependency require the argument --legacy-peer-deps to be passed with npm install.

When deploying to Clever Cloud, the log only shows the command npm install --no-progress, and then fail because of this dependency.

I have tried putting the command in custom environment variable : CC_NODE_BUILD_TOOL or CC_CUSTOM_BUILD_TOOL but the deployment fail the same way.

I have tried putting it in the scripts.install, but this cause the install to recursively call itself each time it is finished.

Is there really no way to circumvent this ? Is there a way to pass the "strict-peer-deps" of npm to false ?

Chris Albert
  • 2,462
  • 8
  • 27
  • 31

1 Answers1

1

You can use a HOOK to run this command after the automatic install step, you can find the list of available hooks here: https://www.clever-cloud.com/doc/develop/build-hooks/.

I advise you to use the CC_POST_BUILD_HOOK environment variable to do this.

Gaël Reyrol
  • 126
  • 6
  • Thanks for your answer. However i need to change the "automatic install step" not what happens after. It's this step that fails the deployment. – Triup Lauro Jun 03 '22 at 15:53
  • You can't add this options to the automatic install step, that's why I am telling you this. To sum up, you are only able to do this after with a hook. – Gaël Reyrol Jun 04 '22 at 11:10
  • So there is no solution since it will always fail. Thanks for letting me know. Guess I'll be dropping this library. – Triup Lauro Jun 04 '22 at 16:26