当我使用命令安装testcafe时,sudo npm install -g testcafe
我可以在终端中使用命令“ testcafe”,运行诸如之类的测试testcafe browser test
,但是现在我格式化了操作系统,并仅将其与npm install
项目的packege.json一起安装,并且尝试使用“ testcafe”命令来运行测试,我收到消息testcafe: command not found
。
现在,只要我调用节点模块,就可以运行测试,例如 /usr/bin/node node_modules/testcafe/bin/testcafe.js browser test
当我使用just安装它时,似乎并未创建用于调用节点模块的“ testcafe”命令别名npm install
。
关于如何解决它或为什么会发生这种情况的任何想法?
这是预期的行为。如果要testcafe
从命令行使用命令,则需要使用-g
参数全局安装testcafe软件包。请参阅以下文章以获取更多详细信息:https : //devexpress.github.io/testcafe/documentation/using-testcafe/installing-testcafe.html
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句