damonbauer / npm-build-boilerplate

A collection of packages that build a website using npm scripts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm run clean not working in windows

MelissaMMDP opened this issue · comments

When I enter npm run clean I receive the error:

'rm' is not recognized as an internal or external command, operable program or batch file.

When I change rm to del I then receive this error:

Invalid switch - "{css".

Can anyone tell me how I need to rewrite the npm scripts file paths so that windows will not throw an error?

hey @MAustinMMDP, try installing rimraf (https://www.npmjs.com/package/rimraf). Windows doesn't have rm, so this package aims to replicate it.

Instead of rm -f dist/{css/*,js/*,images/*}, it'd be something like: rimraf dist/{css/*,js/*,images/*}.

You'll also run into mkdir -p issues, if you try to use that (used in the uglify task). For that, I'd recommend installing the mkdirp module: https://github.com/substack/node-mkdirp.