3

我正在使用 protobuf 进行离子项目,并且我已经安装了 protobuf。弓我想安装 pbjs 工具。我使用 npm install pbjs 在项目目录中这样做了。但是当我使用 pbjs 后跟有效参数时,我得到 -bash: command not found 'pbjs'

我究竟做错了什么?

4

1 回答 1

7

这是因为你还没有全局安装 pbjs,你可以使用全局安装

npm install -g pbjs
或者您甚至可以从项目目录访问它,而无需通过执行全局安装它, node_modules/.bin/pbjs <command you want to execute> 因为您已经在项目目录中安装了它。

于 2017-06-27T19:04:21.243 回答