NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I'm following the guide. Reached the point of installing carto. after what appears to be a successful install, I isssue carto -v which returns:

/usr/lib/nodejs/carto/lib/carto/tree/reference.js:19
    if (mapnik_reference.version.hasOwnProperty(version)) {
                             ^

TypeError: Cannot read property 'hasOwnProperty' of undefined
    at Object.ref.setVersion (/usr/lib/nodejs/carto/lib/carto/tree/reference.js:19:34)
    at /usr/lib/nodejs/carto/lib/carto/tree/reference.js:209:5
    at Object.<anonymous> (/usr/lib/nodejs/carto/lib/carto/tree/reference.js:213:3)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)

However if I invoke carto using sudo, it works fine. I can get by using sudo carto to convert project.mml to mapnik.xml. I'm just wondering what I did wrong!

asked 27 Feb '21, 11:47

G3YAC's gravatar image

G3YAC
5162613
accept rate: 20%

edited 27 Feb '21, 12:30

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866


I'm guessing here, but if something works when run from root but not from a regular user I'm guessing that you did something from root that shouldn't have been done from root?

I'd start by checking project.mml and the rest of the OSM Carto style that you cloned from github.

permanent link

answered 27 Feb '21, 12:32

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

THANKS - It fails with carto -v which is before I try to use project.xml

There's nothing obvious earlier in the chain of setup operations.

(27 Feb '21, 14:10) G3YAC

Good point. Was there anything different to https://switch2osm.org/serving-tiles/manually-building-a-tile-server-20-04-lts/ that you did early on that might cause it? It's not something silly like "disk full" is it? The relevant lines:

sudo apt install npm
sudo npm install -g carto
carto -v

just use Ubuntu's standard npm, and were working just fine the last time I tested it (a couple of months ago)

(27 Feb '21, 14:40) SomeoneElse ♦

The error message points to a too-old version of carto. Type the command which carto as root and as non-root user; my hunch is that you might have installed a new version of carto with "npm install carto" as well as an older version from the Ubuntu distribution with "apt install carto" and that when root you run the correct version and when not root you run the too-old version.

(27 Feb '21, 15:12) Frederik Ramm ♦

I think it is something silly - but not disc full. I found that there was a directory oddity: ~/src/openstreetmap-carto/openstreetmap.carto.

I must have done something stupid when copy/pasting. I just repeated the instructions from 'install mod tile and rendered'. Carto then returned version number as expected without needing sudo. It also processes project.mml to mapnik.xml without sudo but with lots of warnings about style/...not matching layer selector. I'll see what happens next but it is tempting to wipe the VM I'm using and have a fresh start. Thanks for your help.

(27 Feb '21, 15:35) G3YAC
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×36
×23
×1
×1

question asked: 27 Feb '21, 11:47

question was seen: 1,451 times

last updated: 27 Feb '21, 15:35

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum