Deploying always loops back to this issue: E_INVALID_FLAG: Unknown flag "production" #3258
-
Package version"5.3.0" Node.js and npm version14.17.0 - 8.0.0 Sample Code (to reproduce the issue)This issue isn't code specific it seems as though its just with deployment. ProblemWhen deploying i get the following logs which i initially thought was connected to digitalocean but when i used another service and got the same issue i figured out it may be an adonis problem.
I've switched from initially using Yarn which this issue happened with to using NPM and i still get the same error message. It sometimes happens on re-builds and not on the initial build. There doesn't seem to be any pattern (that i can recognise at least) to when it happens. The issue seems to be that the build function isn't found I tried to get a solution on discord and someone mentioned that running |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 5 replies
-
Can you please share how do you upload your project to the production server and how do you install dependencies there? |
Beta Was this translation helpful? Give feedback.
-
Hey thanks for replying, I upload my project to gitlab first, then i choose the branch from DO's apps services. |
Beta Was this translation helpful? Give feedback.
-
I still don't have clarity to the complete process. But anyways, this is happening because the The package is a development dependency and it seems like your server is installing only production dependencies. This happens when |
Beta Was this translation helpful? Give feedback.
-
Okay thanks this actually clears some stuff up,I thought the whole point of dev dependencies is that you don't install them on a production server, I guess i must be missing something here then! I've been following this guide on the adonisjs website for deploying to DO: https://docs.adonisjs.com/cookbooks/deploy-to-digial-ocean#configuring-the-do-app |
Beta Was this translation helpful? Give feedback.
-
Hi, you can try comparing local and server adonis versions: Run: (Context: I use an .sh file to run git pull, build, pm2. Not recommended, but works for now) |
Beta Was this translation helpful? Give feedback.
-
Already had a fix on this? |
Beta Was this translation helpful? Give feedback.
-
Same issue today :/ spent whole day to fix it 😤 |
Beta Was this translation helpful? Give feedback.
I still don't have clarity to the complete process. But anyways, this is happening because the
@adonisjs/assembler
is not installed on your deployment server.The package is a development dependency and it seems like your server is installing only production dependencies. This happens when
NODE_ENV
is set to production or either you are using--production
flag with the npm install command.