mbloch / mapshaper

Tools for editing Shapefile, GeoJSON, TopoJSON and CSV files
http://mapshaper.org
Other
3.74k stars 532 forks source link

TypeError: s.trimEnd is not a function #520

Closed eczajk1 closed 2 years ago

eczajk1 commented 2 years ago

Getting this error at mapshaper@0.5.80:

mapshaper-xl ./my-shp.shp \ snap -simplify .05 keep-shapes \ -o format=shapefile /home/output/simplified.shp
TypeError: s.trimEnd is not a function
    at /usr/local/lib/node_modules/mapshaper/mapshaper.js:18035:15
    at Array.map (<anonymous>)
    at cleanArgv (/usr/local/lib/node_modules/mapshaper/mapshaper.js:18033:17)
    at CommandParser.parseArgv (/usr/local/lib/node_modules/mapshaper/mapshaper.js:18146:18)
    at parseCommands (/usr/local/lib/node_modules/mapshaper/mapshaper.js:36356:30)
    at _runCommands (/usr/local/lib/node_modules/mapshaper/mapshaper.js:39141:18)
    at Object.runCommands (/usr/local/lib/node_modules/mapshaper/mapshaper.js:39044:5)
    at Object.<anonymous> (/usr/local/lib/node_modules/mapshaper/bin/mapshaper:5:11)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
mbloch commented 2 years ago

Could you try installing v0.5.81 and trying again? I switched from trimEnd() and trimStart() to custom trim functions.

It looks like String#trimEnd() was added in Node version 10... are you by any chance using an older version of Node?

eczajk1 commented 2 years ago

Yes that worked. And yes, I was using an old Node version. :sweat_smile:

Thanks - and thanks for this project. Happy Holidays.