Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on window machine #319

Open
kenchoong opened this issue Jul 28, 2020 · 2 comments
Open

Not working on window machine #319

kenchoong opened this issue Jul 28, 2020 · 2 comments

Comments

@kenchoong
Copy link

kenchoong commented Jul 28, 2020

When I tried to run npm run dev-server I get this error:

D:\Desktop\1loc>npm run dev-server

> 1loc@ dev-server D:\Desktop\1loc
> npm run copy && npm run data && webpack-dev-server


> 1loc@ copy D:\Desktop\1loc
> rm -rf dist && mkdir dist && cp -rf public/* dist

'rm' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! 1loc@ copy: `rm -rf dist && mkdir dist && cp -rf public/* dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the 1loc@ copy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!   \2020-07-28T14_20_19_677Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! 1loc@ dev-server: `npm run copy && npm run data && webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the 1loc@ dev-server script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!    -debug.log

is it the rm -rf command is not for window?

@kenchoong
Copy link
Author

I tried to modify line of copy like this

"copy": "rimraf dist && mkdir dist && copy 'public/*' 'dist'"

Then install

npm install rimraf -g

npm run dev-server

But it still not work. Getting this error :

The system cannot find the file specified.

@kenchoong
Copy link
Author

For Window I able to solve this:

First:
npm install --save-dev copyfiles to install copyfiles

Then
npm install --save-dev rimraf

Then modify copy in packages.json like this:
"copy": "rimraf dist && mkdir dist && npx copyfiles public/* dist"

Finally:
npm run dev-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant