npm 复制脚本不适用于 Windows 8.1

npm copy script does not work on Windows 8.1

我有 sapui5 项目,我想 运行 在我的 package.json 中使用以下 npm 脚本:

"scripts": {
   "flatten": "copy -r \dist\resources\test\commonjslib\* dist",
}

这是我的文件夹结构:

commonjslib
  > .che
  > controls
  > dist
    > resources
      > test
        > commonjslib
  > ...
  > ...
  > ...
  > package.json

现在当我 运行 npm 运行 flatten 时,我总是收到以下错误:

The system cannot find the path specified.

当我 运行 在 VSCode 中的 powershell 终端中执行相同的命令时,它就可以工作了。

我的意思是目录在那里,否则命令也不会在 powershell 中工作。

有人知道这里出了什么问题吗?

谢谢

好吧,我发现我必须在命令前面使用 @powershell 键:

"scripts": {
   "flatten": "@powershell copy -r \dist\resources\test\commonjslib\* dist",
}

根据