Description
[Windows] 'cp' is not recognised - npm install issue
Hi folks,
We've just tripped over a small detail whilst introducing a new team member to our hugo+docsy build process. Whilst our CI processes are linux based, and so are are some devs (or Mac in my case), more of our team coming on board are Windows based, and they're having this problem.
We've traced the issue to a modification at 1966f9604c89875c7bfd83b66fbfee4128297ccf
which was introduced a couple of months ago. Specifically package.json
, line 11:
"_cp:bs-rfs": "cp -R node_modules/bootstrap/scss/vendor/* assets/_vendor/bootstrap/scss/",
Running an npm install
on a Windows machine (from either PowerShell or CMD) results in an error of:
Now, I appreciate this is use using pre-release versions of the platform - but I wasn't sure if anyone else had found this yet.
The common answer to solving this is to monkey patch the code for Windows users to use copy
or similar (and change the slashes in the command string too it seems); however this then breaks the code for the *nix users, so we don't like this option.
The next answer has been to get our Windows users to either install Windows Subsystem for Linux (WSL) and use bash there, or the git-bash that comes from with Git-for-windows as part of the mingw32 package.
What I'm wondering is if anyone else has tripped on this, and if so, have they come up with a multi-platform solution yet?