首页 > 解决方案 > npm install 运行正常,但无法运行 topojson

问题描述

如果我做:

npm init
npm install --save topojson

我最终得到了一个 package.json 文件和node_modules目录,看起来都正确。但如果我这样做:

topojson

我懂了:

-bash: topojson: command not found

为什么?

标签: npm

解决方案


试试这个步骤

使用全局安装-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

推荐阅读