When I try to clean a folder with npm by running npm run clean
(code underneath), I get the following error:
rm: cannot remove 'lib/*': No such file or directory
In my package.json, I'm using the following scripts:
{
"scripts": {
"clean": "rm -r lib/*",
"show": "ls lib/*"
}
}
I'm absolutely sure the folder exists. I've tried using single quotes around the lib
path. I know glob expansion is working: the npm run show
works perfectly fine.
I do not want to add any dependencies like rimraf as suggested here. I also do not care about windows support. I know I could use rm -r lib && mkdir lib
which does work. I'm mostly interested in why rm -r lib/*
gives the error. Could someone help me out?
npm version: 5.5.1
node version: 8.9.3