Include additional 2pm packages to NodeJS project

Hi all.
I’m been making steady progress over the past few weeks. I’m new to Wappler but I am finding it, in general, a very nice tool.

I have chosen to use Mapbox services to display maps on my new app. I need to install the npm package for map box. I’ve done this on my local machine but I use docker as my development environment.

Apologies for the newbie question, but how do I include the npm package in my project so it is deployed to my environments please?

Just add the packages you need to package.json and run the package install command from tge bottom toolbar.

Then when you do docker deploy the packages will be automatically included

1 Like

Thanks George.
Alas, my map is blank so I think I have something else to check now :slight_smile:

When creating a new Wappler project make sure you select NodeJS

@George if we add npm packages locally (Docker local) are they not automatically included in package.json for remote Docker environments?

Yes, local package.json next to the rest of your files gets bundled in the docker image that gets deployed.

2 Likes

This worked for me, thanks.

I actually changed my approach to embedding maps in the end.
When a user completes an address form, including the postcode, I perform a backend api lookup against the postcode.io service in order to determine longitude and latitude. I then pass these values to the Mapbox static map tile API. I save the Mapbox URL in a field in my locations table.
This works very nicely. You don’t have the interactive map functionality but in my case I didn’t need that level of map interaction anyway.