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 ?
You can use a
HOOKto 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_HOOKenvironment variable to do this.