Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
npm install运行正确,但无法运行topojson_Npm - Fatal编程技术网

npm install运行正确,但无法运行topojson

npm install运行正确,但无法运行topojson,npm,Npm,如果我这样做: npm init npm install --save topojson 最后,我得到了一个package.json文件和node\u modules目录,看起来都是正确的。但如果我这样做: topojson 我明白了: -bash: topojson: command not found 为什么?试试这一步 使用-g 1. install nodejs http://nodejs.org/ 2. install npm https://npmjs.org/doc/RE

如果我这样做:

npm init
npm install --save topojson
最后,我得到了一个package.json文件和
node\u modules
目录,看起来都是正确的。但如果我这样做:

topojson
我明白了:

-bash: topojson: command not found
为什么?

试试这一步

使用
-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

这个问题的答案与npm无关-
npm install topojson
不再安装名为
topojson
的命令行工具。令人困惑的是,包已更改。

解决方案的可能副本不起作用-如果我执行
$ls./node\u modules/.bin/
我会看到各种模块,但不会看到
topojson
。因此,我假设不是重复的。似乎
topojson
包没有注册
topojson
二进制文件。它确实产生了
geo2topo
toposimplify
topo2geo
topomerge
,以及
topoquantize
。啊,我想这可能与此有关。。。?不知道我实际上应该安装什么,
npm install topojson client
也没有运行
topojson
topojson client
,文档中没有任何内容……谢谢,但我真的很想在本地运行它!