0

I have sapui5 project and I want to run the following npm script in my package.json:

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

Here is my folder structure:

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

Now when I run npm run flatten, I always receive the following error:

The system cannot find the path specified.

When I run the same command in the powershell terminal in VSCode, then it works.

I mean the directory is there, otherwise the commands would not work in powershell either.

Does anyone have an idea what is wrong here?

Thanks

Leon
  • 443
  • 5
  • 19

1 Answers1

0

Ok I found out that I had to use the @powershell key in front of the command:

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

According to https://stackoverflow.com/a/61317319/7719971

Leon
  • 443
  • 5
  • 19