【发布时间】:2015-02-22 10:43:42
【问题描述】:
我是 nodejs 的新手,正在开发 Webstorm 9.0.1,我正在尝试使用 Lab 模块进行测试,使用本教程 https://medium.com/the-spumko-suite/testing-hapi-services-with-lab-96ac463c490a
我的 package.json 文件包含以下内容:
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "./node_modules/lab/bin/lab -c"
},
"author": "",
"license": "ISC",
"devDependencies": {
"hapi": "^8.0.0",
"joi": "^5.0.2",
"lab": "^5.1.0"
}
}
在C:\Users\DT002\WebstormProjects\hapiB\test>目录下创建本地node_modules目录
问题是当我尝试测试时,出现以下错误:
> C:\Users\DT002\WebstormProjects\hapiB\test>npm test
>
> test@1.0.0 test C:\Users\DT002\WebstormProjects\hapiB\test
> ./node_modules/lab/bin/lab -c
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
感谢您的任何建议。
【问题讨论】:
-
请看stackoverflow.com/questions/18413157/…:您需要删除'./'并更改路径分隔符
标签: node.js testing npm webstorm