angular2-electron icon indicating copy to clipboard operation
angular2-electron copied to clipboard

"npm start" fails on Windows

Open miliu99 opened this issue 8 years ago • 2 comments

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.

miliu99 avatar Apr 13 '17 15:04 miliu99

👍

JSponaugle avatar May 10 '17 12:05 JSponaugle

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

spali avatar Jun 21 '17 11:06 spali