Skip to content
How to add a command in deployment
fcaceres98
OP

a year ago

I have an error that I need to add --force to a command

//time picker

npm i [email protected] --force

It works in my local development

npm error

npm error While resolving: @angular/[email protected]

npm error Found: @angular/[email protected]

npm error node_modules/@angular/material

npm error @angular/material@"^17.3.10" from the root project

npm error peer @angular/material@"^17.0.0" from [email protected]

npm error node_modules/ngx-mat-timepicker

npm error ngx-mat-timepicker@"^17.1.0" from the root project

npm error

npm error Could not resolve dependency:

npm error peer @angular/material@"17.3.8" from @angular/[email protected]

npm error node_modules/@angular/material-moment-adapter

npm error @angular/material-moment-adapter@"^17.3.8" from the root project

npm error

npm error Conflicting peer dependency: @angular/[email protected]

npm error node_modules/@angular/material

npm error peer @angular/material@"17.3.8" from @angular/[email protected]

npm error node_modules/@angular/material-moment-adapter

npm error @angular/material-moment-adapter@"^17.3.8" from the root project

npm error

npm error Fix the upstream dependency conflict, or retry

npm error this command with --force or --legacy-peer-deps

npm error to accept an incorrect (and potentially broken) dependency resolution.

$10 Bounty

10 Replies

Railway
BOT

a year ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


starphoneswebtech

a year ago

Are you sure you want to use --force in deployment?

if yes, you can modify it on service settings look for Custom Build Command .


starphoneswebtech

Are you sure you want to use --force in deployment? if yes, you can modify it on service settings look for **Custom Build Command .**

fcaceres98
OP

a year ago

Yes, I really need this to work the library worked a couple a days back. This is my first time Im in this situation can you help me out and explain it step by step.


fcaceres98

Yes, I really need this to work the library worked a couple a days back. This is my first time Im in this situation can you help me out and explain it step by step.

starphoneswebtech

a year ago

go to service settings, scrolldown to the custom build command, npm install --force && npm run build

edit. just realize that you dont need this to run if you force installed it on your local.


starphoneswebtech

go to service settings, scrolldown to the custom build command, npm install --force && npm run build edit. just realize that you dont need this to run if you force installed it on your local.

fcaceres98
OP

a year ago

npm install [email protected] --force && npm run build

Like that or just like you say, npm install --force && npm run build


starphoneswebtech

a year ago

oh, one thing you can do is, npm install --force to your local, commit your package.lock and push it


fcaceres98
OP

a year ago

In my local it works when I push to my repository. I added the custom build command and the error is still their


starphoneswebtech

a year ago

hmm, i think its because of the dependency now

you need to align angular version.

your project has @angular/[email protected]

you can try using @angular/[email protected]

or just add

npm install --legacy-peer-deps && npm run build in custom build command


fcaceres98
OP

a year ago

npm install --legacy-peer-deps && npm run build in custom build command. Didn't work

On my local, I used npm i [email protected] --force, and it works. There are newer versions of this library. Maybe if I update to the latest, I might work I'll try that


starphoneswebtech

a year ago

That could work, make sure you keep all Angular and Angular Material packages on identical versions.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...