Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Npm “的路径问题”;“柏树路”;_Npm_Cypress - Fatal编程技术网

Npm “的路径问题”;“柏树路”;

Npm “的路径问题”;“柏树路”;,npm,cypress,Npm,Cypress,我在Cypress方面取得了很好的进展,但在尝试调用单个规范时有点不顺利 package.json中的行如下所示: "cypress:runST": "cypress run --spec'/cypress/integration/02_DBM_H1_ST_spec.js'", 我从npm run-cypress:runST…错误开始 即使我尝试以以下方式运行此操作: `npm run cypress run --spec '/cypress/integration/02_DBM_H1_S

我在Cypress方面取得了很好的进展,但在尝试调用单个规范时有点不顺利

package.json
中的行如下所示:

  "cypress:runST": "cypress run --spec'/cypress/integration/02_DBM_H1_ST_spec.js'",
我从
npm run-cypress:runST
…错误开始

即使我尝试以以下方式运行此操作:

`npm run cypress run --spec '/cypress/integration/02_DBM_H1_ST_spec.js'
我仍然会遇到错误:

Can't run because no spec files were found.

We searched for any files matching this glob pattern:

'\cypress\integration\02_DBM_H1_ST_spec.js'    
从NPM日志中:

10 silly lifecycle cypress_research@1.0.0~cypress:runST: Args: [ '/d /s /c',
10 silly lifecycle   'cypress run --spec \'/cypress/integration/02_DBM_H1_ST_spec.js\'' ]
11 silly lifecycle cypress_research@1.0.0~cypress:runST: Returned: code: 1  signal: null
12 info lifecycle cypress_research@1.0.0~cypress:runST: Failed to exec cypress:runST script
我有一种感觉,这是命令中的语法,但如果是这种情况,它会运行“bare”……但我得到了相同的错误。不知道'\'afer spec和after.js来自哪里

有什么想法吗?
感谢您从windows命令提示符,
cd
转到cypress文件夹。然后,请尝试运行如下命令

cypress run --spec cypress/integration/02_DBM_H1_ST_spec.js
下面的屏幕截图是我从命令提示符下运行test-spec.js的一个示例


假设package.json与cypress文件夹处于同一级别,这应该可以工作

"cypress:runST": "cypress run --spec cypress/integration/02_DBM_H1_ST_spec.js",

谢谢-这很有效!这是“路径周围引起的问题……尽管这些问题在Cypress网站上是按要求说明的!”!