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

I am trying to deploy Django + tailwind but of course i get the error node.js not found, am i missing something obvious ?
Solution:
you should not define a location at all, your code should be looking in PATH on its own
Jump to solution
51 Replies
Percy
Percy•4mo ago
Project ID: 1e0945e7-1952-485f-b720-005c0cf3e500
Gilthune Aideron
Gilthune AideronOP•4mo ago
1e0945e7-1952-485f-b720-005c0cf3e500
Brody
Brody•4mo ago
do you have a repo you can share that I can tinker with?
Gilthune Aideron
Gilthune AideronOP•4mo ago
I wish i could share it
Brody
Brody•4mo ago
okay then I'd be kinda flying blind, but I'll try
Gilthune Aideron
Gilthune AideronOP•4mo ago
What can i give you that will help ?
Brody
Brody•4mo ago
do you need to run some command that builds assets during build?
Gilthune Aideron
Gilthune AideronOP•4mo ago
yes, i do that as part of my Procfile
Brody
Brody•4mo ago
(assuming you have node available) can you send your Procfile?
Gilthune Aideron
Gilthune AideronOP•4mo 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
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
that one works
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
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
Brody
Brody•4mo ago
okay it's being ran as a start command, got it
Gilthune Aideron
Gilthune AideronOP•4mo ago
I also added Nodejs as part of the settings
Gilthune Aideron
Gilthune AideronOP•4mo ago
No description
Brody
Brody•4mo ago
what was the outcome of that? can you send me your build logs - https://bookmarklets.up.railway.app/log-downloader/
Gilthune Aideron
Gilthune AideronOP•4mo ago
Brody
Brody•4mo ago
hey those are deployment logs
Gilthune Aideron
Gilthune AideronOP•4mo ago
Brody
Brody•4mo 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 Aideron
Gilthune AideronOP•4mo ago
rebuilding now
Gilthune Aideron
Gilthune AideronOP•4mo ago
This does not include the tailwind stuff, as i needed the service up and running and removed that for the time being
Brody
Brody•4mo 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 Aideron
Gilthune AideronOP•4mo ago
Not sure what you want, more info please
Brody
Brody•4mo 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 Aideron
Gilthune AideronOP•4mo ago
No description
Brody
Brody•4mo ago
okay looks not broke anymore. try adding this nixpacks.toml file to your project -
[phases.setup]
nixPkgs = ['...', 'nodejs']
[phases.setup]
nixPkgs = ['...', 'nodejs']
Gilthune Aideron
Gilthune AideronOP•4mo ago
syncing 🙂
Brody
Brody•4mo ago
syncing?
Gilthune Aideron
Gilthune AideronOP•4mo ago
No description
Gilthune Aideron
Gilthune AideronOP•4mo ago
Pushing to git 🙂 ok, still get the error about node/npm not found
Brody
Brody•4mo ago
are you looking for node / npm is a specific place?
Gilthune Aideron
Gilthune AideronOP•4mo ago
no, i am not, looks in the default place as far as i know I can however set it to be anywhere
Brody
Brody•4mo ago
can you temporarily change the start command to print the node and npm version
Gilthune Aideron
Gilthune AideronOP•4mo ago
sure thing rebuilding
v20.12.2

10.5.0
v20.12.2

10.5.0
web: node --version & npm --version
web: node --version & npm --version
Could it just be a path issue ?
Brody
Brody•4mo 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 Aideron
Gilthune AideronOP•4mo ago
not sure, since it should look in the path
Brody
Brody•4mo ago
please look into that
Gilthune Aideron
Gilthune AideronOP•4mo ago
NPM_BIN_PATH = '/usr/local/bin/npm'
NPM_BIN_PATH = '/usr/local/bin/npm'
unless that path is wrong
Brody
Brody•4mo ago
that would be incorrect
Gilthune Aideron
Gilthune AideronOP•4mo ago
any idea's as the the correct path ?
Solution
Brody
Brody•4mo ago
you should not define a location at all, your code should be looking in PATH on its own
Gilthune Aideron
Gilthune AideronOP•4mo ago
removed that setting and pushed again, lets see if that helps
Brody
Brody•4mo ago
have you removed the start command?
Gilthune Aideron
Gilthune AideronOP•4mo ago
yes reverted back to the normal one Looks like that fixed that issue now got some mode errors, but sure i can fix those
Brody
Brody•4mo ago
awsome!
Gilthune Aideron
Gilthune AideronOP•4mo ago
Thank you for the help mate really approiciate it
Brody
Brody•4mo ago
no problem!
Gilthune Aideron
Gilthune AideronOP•4mo ago
now for node hell, but hey one has to do things like that
Brody
Brody•4mo ago
we all have to at some point
Gilthune Aideron
Gilthune AideronOP•4mo ago
again, thank you very much for the quick response
Brody
Brody•4mo ago
happy to help!
Want results from more Discord servers?
Add your server