Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/466.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
Javascript 如何将字符串值参数传递给package.json脚本命令_Javascript_Node.js_Bash_Npm_Environment Variables - Fatal编程技术网

Javascript 如何将字符串值参数传递给package.json脚本命令

Javascript 如何将字符串值参数传递给package.json脚本命令,javascript,node.js,bash,npm,environment-variables,Javascript,Node.js,Bash,Npm,Environment Variables,如何传递包含引号“value”的字符串值 例如,如果我有下面的命令(不起作用) 第一个文件参数是有效的,因为它没有用字符串引号括起来,而对于第二个文件,我需要将runthis测试包装在字符串中,因为我针对的是一个需要检索测试名称的特定场景。它失败了 如果我将我的名字改为runthistest,并且不使用字符串引号,那么脚本将工作 FILE=./path/subpath CASE=runthistest npm run test:one 当然,我不想要这个。。。我希望第一个例子能起作用。有什么建

如何传递包含引号“value”的字符串值

例如,如果我有下面的命令(不起作用)

第一个文件参数是有效的,因为它没有用字符串引号括起来,而对于第二个文件,我需要将runthis测试包装在字符串中,因为我针对的是一个需要检索测试名称的特定场景。它失败了

如果我将我的名字改为runthistest,并且不使用字符串引号,那么脚本将工作

FILE=./path/subpath CASE=runthistest npm run test:one

当然,我不想要这个。。。我希望第一个例子能起作用。有什么建议吗?

在此处转义接受答案中的引号:@RobertRowntree在bash/terminal中传递值时我该如何做
FILE=./path/subpath CASE=runthistest npm run test:one