turf: Can't install latest version due to Topojson being deprecated

No need for a GIST with this error, I’m simply just doing npm i --save @turf/turf so it installs the latest version and I get the following error:

npm WARN deprecated topojson@3.0.2: Use topojson-client, topojson-server or topojson-simplify directly.
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /Users/jose/Sites/myproject/node_modules/topojson/node_modules/topojson-server/bin/geo2topo
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/jose/Sites/myproject/node_modules/topojson/node_modules/topojson-server/bin/geo2topo'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jose/.npm/_logs/2021-05-05T14_14_00_388Z-debug.log

The version I’m trying to install is the latest v6.3.0 Node.js version v14.16.0

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 14
  • Comments: 18 (1 by maintainers)

Most upvoted comments

I had the same issue. Downgrading node to v12 temporarily solves it.

@LuckyCoders have you tried requiring specifically the topojson packages like suggested above? It does look like that, for some reason, fixes the issue. In my case I did not need to downgrade the Node version.

npm i topojson-client topojson-server topojson-simplify

Having this issue too

This is now resolved in the release of v6.4.0

It seems that it is resolved in https://github.com/Turfjs/turf/pull/2037, but not released yet

@stebogit It does seem to be a problem with the @turf/turf library. Uninstalling it resolves the error, but this does mean that I can’t use the complete functionality of the library.

Hy, you just have to install topojson-server (or topojson-client if you are on client side), topojson-simplify before @turf/turf. Hope it helps someone.