Hi all, hoping someone could point me in the right direction here...
We have a need to manually set the package.json NodeJS version to: ^22.9.0 due to dependancies of certain other packages we are using.
However, every time we then open Wappler it changes the version back to: =>16.9.0
Is there another command I need run or setting in Wappler to keep it set it 22? From my understanding it doesn't have anything to do with the local docker project settings as it's the project packages itself and I can't seem to find any other setting.
Have you tried setting it up under Project Options -> Targets - Web. My understanding is that the node environment in a docker deployment is based on the selected node version in each target's Dockerfile.
Thanks guptast. Yes however the package.json has nothing to do with a docker deployment nodeJS setting - at least not for anything local. We run a local docker for dev, and then don't use wappler or docker for the production deployment. The package.json is the bit that's important/read for the production deployment.
I have tried this option as I thought it might also affect how Wappler reads the package.json but it doesn't.
If it is not docker, then what's the deployment method on the production server. That information will provide a better understanding of the production environment.
Hey @apple yes that's correct. We have one target env setup in the project settings, which is our local docker dev dev that we use to run the app locally.
The project setting doesn't seem to affect the package.json file - we currently have the target env set to version 22. And I guess this behaviour is correct as technically you could have multiple target deployments setup which with different nodeJS versions.
We don't use any of the wappler features to deploy to production. We a use custom build and deployment pipeline in AWS.
The whole purpose of a package.json file is to control which packages (or modules) NodeJS uses for your app. Wappler uses a bunch of different NodeJS packages which are all listed in the package.json file - that's the file that gets edited when you run: npm install
The issue isn't the production environment - that works fine. It's that Wappler seems to overwrite the NodeJS version in package.json. Maybe there's some odd dependancy on v16 - maybe I need to look at this more.
A CI/CD pipeline reads the package.json file to install the correct packages etc to build your server for it to work in production.
Hi George, what node engine version do you currently support?
I'm using puppeteer who uses chromium who now apparently need node version 18 and have been unable to update the node to this. I wonder if this is by design and the current supported node is 16.19.0? if so how can i get chromium and puppeteer to work?
How strange. I don't use Heroku so have never selected it as a Server Type. Maybe this is something that needs to be updated in the Beta to include the same options for Node as other Server Types such as Docker...
If you open your Project directory with 'show hidden files and folders' and then open the project.json file (located in the .wappler directory) this is where those settings are located for us:
Please BACKUP your Project before making any changes to this file though! Could try and see if altering the Node version within this file resolves your issue...?
I'm not too sure what you would need to do unfortunately. Was hoping, for your sake, that a simple change would work for you. Might need some input from @George on your above question before moving forwards..
Normally the Node version that is deployed on your server is configured in the package.json file in the root folder of your project. I would start by changing the NodeJS version in that file first.
I haven't had time to try George's suggestion, but it seems to me that the file he referenced is a settings file for Wappler and controls the internal minimum version of NodeJS that Wappler requires (and therefore auto-sets in the root folder package.json file).
Just a heads up, as per the reason for the ticket - Wappler still overwrites the root project folder package.json NodeJS version whenever you open a Wappler file. So you might need to keep an eye on it. We just git so it's easy to see the change and ignore the file for now.
Many thanks i read it the same way as you, I will try again but i'm pretty certain that both project.json files (in the root and in the roaming folder) had the same node specification ">=18.0" and yet version returned 16.20.2