tilemill icon indicating copy to clipboard operation
tilemill copied to clipboard

TileMill fails to build and run on command line (OS X 10.10.2)

Open 1ec5 opened this issue 10 years ago • 15 comments

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.

1ec5 avatar Feb 25 '15 20:02 1ec5

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 avatar Mar 03 '15 16:03 cspanring

@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?

springmeyer avatar Mar 03 '15 17:03 springmeyer

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)

springmeyer avatar Mar 03 '15 18:03 springmeyer

Yep, I was on v0.12.0.

1ec5 avatar Mar 03 '15 18:03 1ec5

Also doesn't seem to work with v0.11.x

jczaplew avatar Mar 11 '15 14:03 jczaplew

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?

jonasmellquist avatar Jun 12 '15 09:06 jonasmellquist

For me the following worked (installing v0.10.39):

  1. install nvm brew install nvm
  2. follow caveats
  3. installl node v0.10.39 nvm install v0.10.39 (i checked newest version with nvm ls-remote)
  4. remove node_modules directory
  5. 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.

dsbaars avatar Jul 02 '15 19:07 dsbaars

cool @dsbaars . Thanks for sharing. It worked for me as well :-) :+1:

deepakshakya avatar Jul 06 '15 06:07 deepakshakya

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",

chadwilcomb avatar Oct 23 '15 14:10 chadwilcomb

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 avatar Nov 30 '15 16:11 triselectif

@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 avatar Nov 30 '15 17:11 cspanring

@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

triselectif avatar Nov 30 '15 19:11 triselectif

@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"

manofry avatar Dec 03 '15 19:12 manofry

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 ?

qij3 avatar Dec 04 '15 06:12 qij3

It worked fine after that, @qij3 ... You should send the full error message, I hadn't seen Notes before.

manofry avatar Dec 04 '15 13:12 manofry