angular2-electron
angular2-electron copied to clipboard
"npm start" fails on Windows
Am I the first one running this in Windows? I got this error after cloning and run npm start:
'cp' is not recognized as an internal or external command, operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-electron: `ng build --base-href . && cp s
rc/electron/* dist`
npm ERR! Exit status 1
npm ERR!
As I figured out, cp in Lunux is copy in windows. However, we also need to change the path seperators, so change this line:
"build-electron": "ng build --base-href . && cp src/electron/* dist",
to this will make npm start work in windows.
"build-electron": "ng build --base-href . && copy src\\electron\\* dist",
Hope it helps someone down the road.
👍
you can also use the npm module cpr and replace the command with "build-electron": "ng build --base-href . && cpr src/electron dist
then it should work on all platforms