我在package.json中有这个简单的脚本:
"files-copy:test": "copy ./robot_test.txt ./dist/robot.txt"
如果我直接从cmd行运行它:
> copy ./robot_test.txt ./dist/robot.txt
它正常工作,但是如果我将其作为npm脚本运行:
> npm run files-copy:test
它给了我错误:
> npm run files-copy:test
> copy ./robot_test.txt ./dist/robot.txt
The syntax of the command is incorrect.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project@0.24.8 files-copy:test: `copy ./robot_test.txt ./dist/robot.txt`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project@0.24.8 files-copy:test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\aaaa\AppData\Roaming\npm-cache\_logs\2020-10-06T09_03_54_801Z-debug.log
谁能解释我为什么?