custom npm install command

AnonymousTRIAL

2 years ago

hey yall! i had a question about custom npm installations: it doesnt seem like that is yet available in your ui? maybe im looking in the wrong place but would love some help! thanks!

0 Replies

AnonymousTRIAL

2 years ago

5b02d386-c049-460c-bcf9-d7235c54b6f9


2 years ago

so by default it should be npm ci if there's a package lock file, otherwise it's npm i

can you tell me why these install commands don't work for you?


AnonymousTRIAL

2 years ago

i got this resolved, thanks


2 years ago

would you mind telling me anyway? what was your desired install command?


AnonymousTRIAL

2 years ago

npm i --force


2 years ago

oh that's not a good idea


2 years ago

but I'm not gonna open that can of worms


AnonymousTRIAL

2 years ago

its due to some of the dependencies im working with. plus i believe in the newest npm versions, --force is better than --legacy-peer-deps


2 years ago

neither is good lol


AnonymousTRIAL

a year ago

Hi, I know --force is not a good idea, but I need to use it. How can I add npm i --force as a custom install script?


a year ago

with a nixpacks.toml file -

[phases.install]
    cmds = ['npm i --force']

AnonymousTRIAL

a year ago

Thanks Brody, I dug a bit deeper and I found this in the forum:

1237649187529560000


a year ago

yep, thats the correct way, but you said you where aware it wasnt a good idea and asked anyway, so i answered your question directly