Anyone manage to get Django + Django tailwind to deploy correctly ?
gilthune
HOBBYOP

2 years ago

I am trying to deploy Django + tailwind but of course i get the error node.js not found, am i missing something obvious ?

65 Replies

gilthune
HOBBYOP

2 years ago

1e0945e7-1952-485f-b720-005c0cf3e500


2 years ago

do you have a repo you can share that I can tinker with?


gilthune
HOBBYOP

2 years ago

I wish i could share it


2 years ago

okay then I'd be kinda flying blind, but I'll try


gilthune
HOBBYOP

2 years ago

What can i give you that will help ?


2 years ago

do you need to run some command that builds assets during build?


gilthune
HOBBYOP

2 years ago

yes, i do that as part of my Procfile


2 years ago

(assuming you have node available)


2 years ago

can you send your Procfile?


gilthune
HOBBYOP

2 years ago

web: python manage.py qcluster --settings=main.settings & python manage.py collectstatic --noinput && uvicorn main.asgi:application --host 0.0.0.0 --port $PORT --log-level debug

gilthune
HOBBYOP

2 years ago

that one works


gilthune
HOBBYOP

2 years ago

web: python manage.py qcluster --settings=main.settings & python manage.py collectstatic --noinput & python manage.py tailwind build && uvicorn main.asgi:application --host 0.0.0.0 --port $PORT --log-level debug

Gives me a error, about not finding node


2 years ago

okay it's being ran as a start command, got it


gilthune
HOBBYOP

2 years ago

I also added Nodejs as part of the settings


gilthune
HOBBYOP

2 years ago

1267456768997589000


2 years ago

what was the outcome of that?


2 years ago

can you send me your build logs -


gilthune
HOBBYOP

2 years ago


2 years ago

hey those are deployment logs


gilthune
HOBBYOP

2 years ago


2 years ago

adding node as a provider wasn't the move, can you remove it and then send me the new build logs, it's not going to fix your issue but I need to first see if your build plan is still messed up


gilthune
HOBBYOP

2 years ago

rebuilding now


gilthune
HOBBYOP

2 years ago


gilthune
HOBBYOP

2 years ago

This does not include the tailwind stuff, as i needed the service up and running and removed that for the time being


2 years ago

looks like those logs don't include what I wanted to see, can you send me the build table from those build logs please


gilthune
HOBBYOP

2 years ago

Not sure what you want, more info please


2 years ago

scroll all the way up to the top of the build logs and send me a screenshot of the build table, you will know it when you see it!


gilthune
HOBBYOP

2 years ago

1267460566805512200


2 years ago

okay looks not broke anymore.

try adding this nixpacks.toml file to your project -

[phases.setup]
    nixPkgs = ['...', 'nodejs']

gilthune
HOBBYOP

2 years ago

syncing 🙂


2 years ago

syncing?


gilthune
HOBBYOP

2 years ago

1267462518507311000


gilthune
HOBBYOP

2 years ago

Pushing to git 🙂


gilthune
HOBBYOP

2 years ago

ok, still get the error about node/npm not found


2 years ago

are you looking for node / npm is a specific place?


gilthune
HOBBYOP

2 years ago

no, i am not, looks in the default place as far as i know


gilthune
HOBBYOP

2 years ago

I can however set it to be anywhere


2 years ago

can you temporarily change the start command to print the node and npm version


gilthune
HOBBYOP

2 years ago

sure thing


gilthune
HOBBYOP

2 years ago

rebuilding


gilthune
HOBBYOP

2 years ago

v20.12.2

10.5.0

gilthune
HOBBYOP

2 years ago

web: node --version & npm --version 

gilthune
HOBBYOP

2 years ago

Could it just be a path issue ?


2 years ago

yep so node and npm are there for sure, your code is just looking in the wrong place, your code should be looking in PATH


gilthune
HOBBYOP

2 years ago

not sure, since it should look in the path


2 years ago

please look into that


gilthune
HOBBYOP

2 years ago

NPM_BIN_PATH = '/usr/local/bin/npm'

gilthune
HOBBYOP

2 years ago

unless that path is wrong


2 years ago

that would be incorrect


gilthune
HOBBYOP

2 years ago

any idea's as the the correct path ?


2 years ago

you should not define a location at all, your code should be looking in PATH on its own


gilthune
HOBBYOP

2 years ago

removed that setting


gilthune
HOBBYOP

2 years ago

and pushed again, lets see if that helps


2 years ago

have you removed the start command?


gilthune
HOBBYOP

2 years ago

yes


gilthune
HOBBYOP

2 years ago

reverted back to the normal one


gilthune
HOBBYOP

2 years ago

Looks like that fixed that issue now got some mode errors, but sure i can fix those


2 years ago

awsome!


gilthune
HOBBYOP

2 years ago

Thank you for the help mate


gilthune
HOBBYOP

2 years ago

really approiciate it


2 years ago

no problem!


gilthune
HOBBYOP

2 years ago

now for node hell, but hey one has to do things like that


2 years ago

we all have to at some point


gilthune
HOBBYOP

2 years ago

again, thank you very much for the quick response


2 years ago

happy to help!


Loading...