2014-11-23 174 views
0

我正在尝试使用npm安装json验证程序(jsonlint)。我使用包管理器安装npm如何使用npm来安装和运行软件包?

命令和apt-get安装NPM

然后我试图安装jsonlint使用命令

须藤NPM安装jsonlint

哪个产生了一堆以

结尾的输出
[email protected] node_modules/jsonlint 
├── [email protected] ([email protected], [email protected]) 
└── [email protected] 

根据the documentation for jsonlint我现在应该可以简单地运行jsonlint命令,但我得到一个错误,而不是:

定量@的OptiPlex-990:〜$ jsonlint 程序“jsonlint”目前还没有安装。您可以通过键入以下内容进行安装: sudo apt-get install python-demjson

显然,安装的软件包未被识别。在这种情况下,它看起来像建议的Ubuntu包可能做同样的任务,但我有兴趣让npm工作。

回答

1

如果您想在系统的任何位置从命令行使用jsonlint,则需要全局安装。

$ sudo npm install -g jsonlint 

没有-g标志,它将安装在当前项目目录中。

+0

因此,该软件包已安装,现在我们如何使用它?专门将其用作角度模块。 – alphapilgrim 2016-03-29 20:47:58