[英]cannot run node command without using npm
I am working on a new node project in windows machine.我正在 windows 机器上开发一个新的节点项目。
In my package.json I've set test script:在我的package.json我设置了测试脚本:
"scripts": {
"test": "cucumber-js test"
},
If I run the command > npm run test
it works properly, but if I run > cucumber-js test
I get the following error:如果我运行命令
> npm run test
它可以正常工作,但是如果我运行> cucumber-js test
我会收到以下错误:
cucumber-js : The term 'cucumber-js' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:1
+ cucumber-js test
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (cucumber-js:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Is there any explanation?有什么解释吗? How can I resolve it?
我该如何解决?
As mentioned in the comments the problem is resolved by providing the exact path: .\node_modules\.bin\cucumber-js test
如评论中所述,通过提供确切路径解决了问题:
.\node_modules\.bin\cucumber-js test
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.