找不到节点包的命令行界面

时间:2022-07-17 00:13:00

I installed a node.js (I think) package using the npm i -g [package] command. This package (MJML) has a command line tool. According to their documentation, there should be a command line tool included in the package, but when i use the command mjml demo.mjml i get the error -bash: mjml: command not found I've noticed that there is a separate CLI package which i've also installed, but I received the same error.

我使用npm i -g [package]命令安装了node.js(我认为)软件包。这个包(MJML)有一个命令行工具。根据他们的文档,应该有包中包含一个命令行工具,但是当我使用命令mjml demo.mjml我得到的错误-bash:找不到命令我注意到,有一个单独的CLI包:mjml我也安装了,但我收到了同样的错误。

My question is: Is there a change I need to make to allow node packages to use command line tools?

我的问题是:是否需要进行更改以允许节点包使用命令行工具?

I'm using OSX El Capitan 10.11.6

我正在使用OSX El Capitan 10.11.6

1 个解决方案

#1


0  

It might be a silly question, but are you sure the package was successfully installed?

这可能是一个愚蠢的问题,但您确定包已成功安装吗?

Sometimes you need to install global packages as an admin with sudo npm install [package] -g.

有时您需要使用sudo npm install [package] -g作为管理员安装全局包。

#1


0  

It might be a silly question, but are you sure the package was successfully installed?

这可能是一个愚蠢的问题,但您确定包已成功安装吗?

Sometimes you need to install global packages as an admin with sudo npm install [package] -g.

有时您需要使用sudo npm install [package] -g作为管理员安装全局包。

相关文章