且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 mac 终端上找不到 jsx 命令

更新时间:2023-11-17 09:41:52

运行:

npm config get prefix

这将为您提供有关全局 npm 模块安装位置的线索.您需要将上述返回的目录下的bin目录添加到您的路径中.例如,它可能会返回/usr/local,在这种情况下,您应该将/usr/local/bin 添加到您的 PATH 中.你可以这样做:

that will give you a clue as to where your global npm modules are installed. you need to add the bin directory under the directory returned by the above to your path. for example, it might return /usr/local, in which case you should add /usr/local/bin to your PATH. You could just do:

export PATH=$PATH:$(npm config get prefix)/bin