Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Installation fails on vanilla Ubuntu 16.04.2 LTS #468

Closed
SomeoneElseOSM opened this issue Feb 28, 2017 · 8 comments
Closed

Installation fails on vanilla Ubuntu 16.04.2 LTS #468

SomeoneElseOSM opened this issue Feb 28, 2017 · 8 comments

Comments

@SomeoneElseOSM
Copy link

(logged here as requested by gravitystorm/openstreetmap-carto#2576 (comment) )

sudo apt install npm
sudo npm install -g carto

npm ERR! Linux 4.4.0-64-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "carto"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! [email protected] postinstall: node generate.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node generate.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mapnik-reference package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node generate.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs mapnik-reference
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls mapnik-reference
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/renderaccount/npm-debug.log
npm ERR! code 1

For info /home/renderaccount/npm-debug.log is 10k lines long and 847k in size; does that need to be added here too?

@nebulon42
Copy link
Collaborator

Thanks, this is actually a problem with mapnik-reference. I have seen this sporadically, but am not sure why it sometimes does not work. I think carto may still work correctly if npm installed it despite this error.

Tracked in mapnik/mapnik-reference#133.

@springmeyer
Copy link

@nebulon42 I think the problem may be the order that different npm versions execute hook like preinstall and postinstall. I've seen preinstall usage with node-pre-gyp work 99% of the time - it seems, and failures increase on windows and with node via stock ubuntu. This is somewhat captured at mapbox/node-pre-gyp#260.

Take home: I don't know what exactly is wrong, but I sense that staying away from preinstall and postinstall in npm is advisable. I recall working with you to settle on postinstall.... hmmm

@nebulon42
Copy link
Collaborator

@SomeoneElseOSM A workaround for the problem is to install the package nodejs-legacy. This enables the Node.js binary under node which should make the error go away.

@nebulon42
Copy link
Collaborator

ref mapnik/mapnik-reference#137

@nebulon42 nebulon42 removed this from the 1.0 milestone May 31, 2017
@nebulon42
Copy link
Collaborator

This is now fixed by v0.18.1

@SomeoneElseOSM
Copy link
Author

Exactly the same problem still seems to be present. If I do:

sudo apt install npm
sudo npm install -g carto

and run "carto -v" I get:
carto 0.9.5 (Carto map stylesheet compiler)
(that's the version from the Ubuntu repository)

Also if I do:

sudo apt install nodejs-legacy
sudo npm install -g carto

and run "carto -v" I get:
carto 0.9.5 (Carto map stylesheet compiler)

To be clear - the title of this bug is "Installation fails on vanilla Ubuntu 16.04.2 LTS". To fix it, I'd expect some information about how to make installation not fail on a vanilla Ubuntu 16.04.2 LTS, and I'd expect that information to be contained in https://github.com/mapbox/carto/blob/master/README.md which still just says "npm install -g carto".

@nebulon42
Copy link
Collaborator

You really should remove the hopelessly outdated 0.9.5 version by uninstalling the node-carto package and then try again.

Also please post the NPM output again. Which version of carto is installed by doing npm install -g carto? Is it 0.18.1? If so, then the problem should be fixed. Otherwise there is still work to do and I will reopen this issue.

@SomeoneElseOSM
Copy link
Author

SomeoneElseOSM commented Jun 7, 2017

Thanks - when I "dpkg -r node-carto", "carto -v" suggests that 0.18.1 is installed (and it can process the latest osm-carto's .mml file). I'll try it again "soup to nuts" and check that it all works.

Edit: It works!

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

No branches or pull requests

3 participants