tilemill
tilemill copied to clipboard
TileMill fails to build and run on command line (OS X 10.10.2)
Following the instructions in the README, I get this failure when running ./index.js
on OS X 10.10.2:
/Users/mxn/hub/tilemill/node_modules/tilelive/lib/statistics.js:24
set remaining() {}, // read-only
^
SyntaxError: Unexpected token )
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/mxn/hub/tilemill/node_modules/tilelive/lib/scheme.js:1:80)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
Looks like it’s coming from a dependency of mapbox/tilelive.js, but I’m not sure which one.
I was just seeing the same issue. Trying to hunt down the error, led me to finally downgrading node.js from 0.12 to 0.10.36, which solved the issue. FWIW, tests for tilelive.js were passing with node 0.12.
@cspanring - thanks for sharing that node v0.12.x was the issue for you. @1ec5 - were you also using node v0.12.x when you hit this?
replicated and confirmed that node v0.12.x support is broken. Also broken is the jsdom version used:
$ ./index.js
/Users/dane/projects/tilemill/node_modules/jsdom/lib/jsdom/level1/core.js:554
Array.prototype.splice.call(this._childNodes, refChildIndex, 0, newChild
^
TypeError: Cannot set property length of [object Object] which has only a getter
at Object.core.Node.insertBefore (/Users/dane/projects/tilemill/node_modules/jsdom/lib/jsdom/level1/core.js:554:30)
at Object.<anonymous> (/Users/dane/projects/tilemill/node_modules/jsdom/lib/jsdom/level2/events.js:314:20)
at Object.proto.(anonymous function) [as insertBefore] (/Users/dane/projects/tilemill/node_modules/jsdom/lib/jsdom/utils.js:23:26)
at Object.core.Node.appendChild (/Users/dane/projects/tilemill/node_modules/jsdom/lib/jsdom/level1/core.js:672:17)
at /Users/dane/projects/tilemill/node_modules/jquery/node-jquery.js:1210:15
at /Users/dane/projects/tilemill/node_modules/jquery/node-jquery.js:1423:3
at create (/Users/dane/projects/tilemill/node_modules/jquery/node-jquery.js:9059:3)
at /Users/dane/projects/tilemill/node_modules/jquery/node-jquery.js:9065:18
at Object.<anonymous> (/Users/dane/projects/tilemill/node_modules/jquery/node-jquery.js:9067:2)
at Module._compile (module.js:460:26)
Yep, I was on v0.12.0.
Also doesn't seem to work with v0.11.x
I'm also getting this error on OS X 10.9.5 Tried using nvm to get both v0.10.36 and v0.10.26 og Node, still giving me the same error.. Any ideas on how to making it work?
For me the following worked (installing v0.10.39):
- install nvm
brew install nvm
- follow caveats
- installl node v0.10.39
nvm install v0.10.39
(i checked newest version with nvm ls-remote) - remove
node_modules
directory - run
npm install
Still it would be nice to fix the official Mac OS X binary, instead of following the instructions at http://www.the-nerd.be/2014/12/01/run-mapbox-tilemill-on-osx-yosemite-10-10/ and finding out you need to downgrade.
cool @dsbaars . Thanks for sharing. It worked for me as well :-) :+1:
Thanks for your solution @dsbaars. I added the following line to my scripts section of package.json to allow tilemill to run in version v0.10.39 of npm with the npm start
command.
"prestart":". ~/.nvm/nvm.sh use v0.10.39",
Hi Thank you a lot @dsbaars for this trick on downgrading to v0.10.39 It worked for me too ! .. until recently ..
tilemill/node_modules/connect/node_modules/qs/lib/index.js:5
const Stringify = require('./stringify');
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/onra/Documents/mapbox/tilemill/node_modules/connect/lib/middleware/bodyParser.js:13:10)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
i can't find a working solution to that..
@triselectif const
is part of ES6, which is not supported by node 0.10.x. You would need to replace the failing dependency with a pre-ES6 version.
qs dependency of connect
in tile mill/node_modules
is failing in your case. Try version 5.2 of qs
, which seems to be the last one before the ES6 switch.
This will likely to be a pattern of errors from now on, as more node modules will start using ES6...
@cspanring thanks a lot for this explanation. Indeed, from now on it will be safe to keep a Windows exe version of Tilemill on a spare computer
@cspanring Thanks a lot, that worked for me renamed tilemill/node_modules/connect/node_modules/qs/ to something else downloaded https://github.com/hapijs/qs/archive/v5.2.0.tar.gz extracted to tilemill/node_modules/connect/node_modules/ renamed folder to "qs"
Thanks, @manofry it works. However is getting new Note. Note: Unknown option "profile" in config file. Note: Unknown option "updatesVersion" in config file. Note: Unknown option "updatesTime" in config file.
Are you having same issues ?
It worked fine after that, @qij3 ... You should send the full error message, I hadn't seen Notes before.