Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing *any plugin* with master version (with Docker) #302

Open
mrg218 opened this issue May 23, 2019 · 5 comments
Open

Error installing *any plugin* with master version (with Docker) #302

mrg218 opened this issue May 23, 2019 · 5 comments

Comments

@mrg218
Copy link

mrg218 commented May 23, 2019

I found a working Docker version of kosmtik 0.0.16 : https://hub.docker.com/r/joxit/kosmtik/dockerfile

But I want to have a working version of the master version (which uses a newer Mapnik version).

I do the following to install it:

RUN apt-get update
&& apt-get install -y --no-install-recommends curl ca-certificates gpg
&& curl -sL https://deb.nodesource.com/setup_6.x | bash -
&& apt-get install -y nodejs
&& curl -sL https://github.com/kosmtik/kosmtik/archive/master.tar.gz | tar xz --strip-components=1
&& npm install --production
&& node index.js plugins --install kosmtik-mbtiles-export

But the result is:

[Core] No usable config file found in /root/.config/kosmtik.yml
[Core] Loading plugin from ../plugins/base-exporters/index.js
[Core] Loading plugin from ../plugins/hash/index.js
[Core] Loading plugin from ../plugins/local-config/index.js
[Core] Loading plugin from ../plugins/datasource-loader/index.js
[Core] Starting installation of kosmtik-mbtiles-export
/opt/kosmtik/node_modules/npm/node_modules/bluebird/js/release/async.js:61
fn = function () { throw arg; };
^

TypeError: Cannot convert undefined or null to object
at /opt/kosmtik/src/back/PluginsManager.js:100:38
at tryCatcher (/opt/kosmtik/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)

I would be interested to know if any of you is able to install any of the Known Plugins mentioned on github with the master version of kosmtik. And if so, what OS and version of node you are using

I am using:
OS: debian:stable
node: v6.16.0
npm: 3.10.10

@mrg218 mrg218 changed the title Error installing master version with Docker Error installing *any plugin* with master version (with Docker) May 27, 2019
@yohanboniface
Copy link
Member

plugins management through kosmtik is deprecated (the npm api totally disappeared), so for now one should install the normal way:

npm install kosmtik-mbtiles-export

@Ircama
Copy link

Ircama commented Mar 2, 2021

npm install kosmtik-mbtiles-export

This way the installation does not fail, but the plugins are not loaded. Example:

sudo npm install --unsafe-perm -g git+https://github.com/kosmtik/kosmtik
sudo npm install -g kosmtik-map-compare
kosmtik plugins --installed

Output:

[Core] No usable config file found in /home/ubuntu/.config/kosmtik.yml
[Core] Loading plugin from ../plugins/base-exporters/index.js
[Core] Loading plugin from ../plugins/hash/index.js
[Core] Loading plugin from ../plugins/local-config/index.js
[Core] Loading plugin from ../plugins/datasource-loader/index.js
[Core] Loading plugin from ../plugins/version/index.js
Installed plugins
../plugins/base-exporters/index.js
../plugins/hash/index.js
../plugins/local-config/index.js
../plugins/datasource-loader/index.js
../plugins/version/index.js

kosmtik-map-compare is not loaded. How can this be fixed?

@yohanboniface
Copy link
Member

Yes, that's an issue. Kosmtik used to have an internal command to install and register plugins, but npm is not more usable as a package.
This needs to be fixed in the kosmtik package, but I'm unsure how at this time.
In your case, you can register the plugins manually:

In the file /home/ubuntu/.config/kosmtik.yml, add:

plugins:
  - kosmtik-fetch-remote
  - kosmtik-map-compare
  - kosmtik-mbtiles-export
  …

And so on.

@Ircama
Copy link

Ircama commented Mar 3, 2021

@yohanboniface, thanks a lot!

This works with Ubuntu 20.04.2 LTS (for testing openstreetmap-carto):

# Install nodejs:
sudo apt install -y nodejs npm

# Install kosmtik:
sudo npm install --unsafe-perm -g git+https://github.com/kosmtik/kosmtik

# Install kosmtik plugins:
sudo npm install -g leaflet
sudo npm install -g leaflet-editinosm
sudo npm install -g leaflet.photon
sudo npm install -g osmtogeojson

# Plugins that should work:
sudo npm install -g git+https://github.com/kosmtik/kosmtik-overpass-layer # Add overpass layers to your Kosmtik project
sudo npm install -g git+https://github.com/kosmtik/kosmtik-fetch-remote # Kosmtik plugin to fetch remote layer data
sudo npm install -g git+https://github.com/kosmtik/kosmtik-overlay # Add an overlay in Kosmtik
sudo npm install -g git+https://github.com/kosmtik/kosmtik-map-compare # Add a map to compare side-by-side with your work in Kosmtik
sudo npm install -g git+https://github.com/kosmtik/kosmtik-osm-data-overlay # Display OSM data on top of your map in Kosmtik.
sudo npm install -g git+https://github.com/kosmtik/kosmtik-tiles-export # Export tiles tree of your Kosmtik map
sudo npm install -g git+https://github.com/kosmtik/kosmtik-deploy # Deploy your Kosmtik project on a remote server
sudo npm install -g git+https://github.com/kosmtik/kosmtik-mapnik-reference # Browse Mapnik and CartoCSS reference in Kosmtik; needs  --mapnik-version 3.0.20
sudo npm install -g git+https://github.com/kosmtik/kosmtik-open-in-josm # Add a control in Kosmtik to open your favorite OSM editor with the current
sudo npm install -g git+https://github.com/kosmtik/kosmtik-geojson-overlay # Show a geojson overlay on top of your Kosmtik map
sudo npm install -g git+https://github.com/kosmtik/kosmtik-place-search # Search control for Kosmtik

# Plugins that might not work:
sudo npm install -g git+https://github.com/kosmtik/kosmtik-magnacarto # Magnacarto renderer support for Kosmtik
sudo npm install -g git+https://github.com/kosmtik/kosmtik-mbtiles-export # Export your Kosmtik project in MBTiles
sudo npm install -g git+https://github.com/kosmtik/kosmtik-mbtiles-source # Use an MBTiles file as a source for a vector tile based probject in kosmtik
sudo npm install -g git+https://github.com/kosmtik/kosmtik-places # Bookmark places in Kosmtik

# Activate plugins:
mkdir -p /home/$USER/.config
cat > /home/$USER/.config/kosmtik.yml <<\eof
plugins:
  # Plugins that should work:
  - kosmtik-fetch-remote
  - kosmtik-geojson-overlay
  - kosmtik-map-compare
  - kosmtik-overlay
  - kosmtik-overpass-layer
  - kosmtik-tiles-export
  - kosmtik-deploy
  - kosmtik-mapnik-reference # this needs --mapnik-version 3.0.20
  - kosmtik-open-in-josm # this only works locally
  - kosmtik-osm-data-overlay
  - kosmtik-place-search
  # Plugins that might not work:
  #- kosmtik-magnacarto
  #- kosmtik-mbtiles-export
  #- kosmtik-places
  #- kosmtik-mbtiles-source
eof

# Test installation:
kosmtik version

# Run Kosmtik:
kosmtik serve project.mml --host 0.0.0.0 --mapnik-version 3.0.20

@JBacc1
Copy link

JBacc1 commented Mar 15, 2021

Thanks a lot. I guess this should find its place in the readme, or at least a link to it. I would never have managed without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants