'cbimport' 不是内部或外部命令,也不是可运行的程序或批处理文件

'cbimport' is not recognized as an internal or external command, operable program or batch file

我开始学习 couchbase。一切顺利。我正在按照 couchbase 官方网站的分步指南进行操作。在某一点上,这个循序渐进的教程建议我使用命令提示符 运行。在这里,我复制了确切的指南:

 1.Open a Command (Terminal) window, and navigate to the Couchbase ​bin
​ folder. 

Mac OSX /Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/ Windows C:\Program Files\Couchbase\Server\bin\ Linux /opt/couchbase/bin/ 

11.Add this folder to your operating system PATH statement, so that its commands may be invoked from any location. If needed, see your operating system documentation for specific details on this process. 12.In the Terminal, navigate to the ​/CB121
​ folder on your desktop, which contains the products-data.json 
​ file and ​orders-data.json
​ file. 




13.Use the ​cbimport 
​ tool to load the JSON documents in ​products-data.json
​ to the WineSearch
​ bucket (bucket names are case sensitive). To ensure uniqueness, assign an incrementing integer (​#MONO_INCR#
​ ) value to each record as part of its document key, prefixed by its ​type
​ and ​variety
​ , using "​::
​ " as a separator. 
 ❏ Cluster (-c): couchbase://127.0.0.1 ❏ Username (-u): WineSearcher ❏ Password (-p): password ❏ Bucket (-b): WineSearch ❏ Format (-f): lines ❏ Dataset (-d): file://products-data.json ❏ Threads (-t): 4 ❏ Key Pattern to Generate (-g): %type%::%variety%::#MONO_INCR# 


 cbimport json -c couchbase://127.0.0.1 -u WineSearcher -p password -b WineSearch -f lines -d file://products-data.json -t 4 -g %type%::%variety%::#MONO_INCR# 



Note, code statements in this document can be copied and pasted to your tool. 

当我 运行 这个命令时 cbimport json -c couchbase://127.0.0.1 -u WineSearcher -p password -b WineSearch -f lines -d file://products-data.json -t 4 -g %type%::%variety%::#MONO_INCR# 我收到以下错误:

'cbimport' is not recognized as an internal or external command, operable program or batch file.

在我看来,我可能需要安装任何工具,例如 cbimport。我用谷歌搜索了几个小时。没有这样的工具。我觉得自己像个傻瓜。任何帮助表示赞赏。

N.B: 我设置的环境变量如下:

您的文件不在路径中。这样应该可以解决(或者在cbimport之后加上.exe

"C:\Program Files\Couchbase\Server\bin\cbimport" json -c couchbase://127.0.0.1 -u WineSearcher -p password -b WineSearch -f lines -d file://products-data.json -t 4 -g %type%::%variety%::#MONO_INCR#

注意!! 现在您必须确保设置正确的 JSON 文件路径。

但是,您希望它尽可能短,因此在您的路径变量中添加 C:\Program Files\Couchbase\Server\bin,方法是:

Control panel -> System -> Environment Variables

找到 `PATH 并添加

;C:\Program Files\Couchbase\Server\bin 在路径的末尾,然后保存并退出。

重要的是现在你需要关闭你的cmd.exewindows然后重新打开,否则它仍然会读取旧环境。