-3

If I do:

npm init
npm install --save topojson

I end up with a package.json file and node_modules directory, all looking correct. But if I then do:

topojson

I see:

-bash: topojson: command not found

Why?

Richard
  • 62,943
  • 126
  • 334
  • 542
  • Possible duplicate of [How to use package installed locally in node\_modules?](https://stackoverflow.com/questions/9679932/how-to-use-package-installed-locally-in-node-modules) – E_net4 Sep 04 '18 at 13:08
  • The solution there doesn't work - if I do `$ ls ./node_modules/.bin/` I see various modules but not `topojson`. So not a duplicate, I assume. – Richard Sep 04 '18 at 13:30
  • It seems that the `topojson` package does not register a `topojson` binary. It does yield `geo2topo`, `toposimplify`, `topo2geo`, `topomerge`, and `topoquantize`. – E_net4 Sep 04 '18 at 13:35
  • Ah I think this might have something to do with it...? https://stackoverflow.com/questions/47462775/topojson-command-not-added-on-npm-install#comment82532432_47462775 No idea what I'm actually supposed to install though, `npm install topojson-client` doesn't get `topojson` or `topojson-client` running either and there's nothing in the docs.... – Richard Sep 04 '18 at 14:22

2 Answers2

0

The answer to this issue turned out not to be related to npm - npm install topojson no longer installs a command-line tool called topojson. Confusingly, it used to, but the package has changed.

Richard
  • 62,943
  • 126
  • 334
  • 542
-1

try this step

install globally using -g

 1. install nodejs http://nodejs.org/
 2. install npm https://npmjs.org/doc/README.html
 3. run npm install -g topojson in your command prompt
 4. use the command prompt to cd to the geojson file
 5. run topojson -o myNewTopojsonFile.json myOldGeojsonFile.json
Bhargav Chudasama
  • 6,928
  • 5
  • 21
  • 39