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

Build error on Windows #135

Open
rkachach opened this issue Oct 29, 2020 · 5 comments
Open

Build error on Windows #135

rkachach opened this issue Oct 29, 2020 · 5 comments

Comments

@rkachach
Copy link

rkachach commented Oct 29, 2020

it seems that scripts are meant for a Linux machine. Is there anyway to build for windows?

rm -rf dist && npm run build

"rm" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mumble-web@0.5.1 prepare: `rm -rf dist && npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mumble-web@0.5.1 prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@joker-x
Copy link
Contributor

joker-x commented Oct 29, 2020

I had not test it, but it should works:

rmdir dist /s
webpack
copy app\config.local.js dist\

@rkachach
Copy link
Author

Thanks for the quick response.

I modified this line and after adding the following to webpack.config.js (because I was getting an error 'cannot resolve fs':

config.node = { fs: 'empty' };
module.exports = {

Now I have this error:

var config = Encore.getWebpackConfig();
config.node = { fs: 'empty' };

Anyway, is Windows supported or should I switch to a Linux machine?

@joker-x
Copy link
Contributor

joker-x commented Oct 29, 2020

Here webpack-contrib/css-loader#447 (comment) recommend to use

target: 'node',

instead of fs:'empty'

Anyway, i think that always is better works in a linux machine ;)

@rkachach
Copy link
Author

Thanks, I fixed this now I'm getting the following, any clues?

> webpack && [ -f dist/config.local.js ] || copy app\config.local.js dist

D:\Projects\mumble-web\node_modules\webpack-cli\bin\cli.js:93
                                throw err;
                                ^
ReferenceError: Encore is not defined

@jaballogian
Copy link

jaballogian commented Jan 12, 2023

I have been facing a similar issue here for days.
The error came after I ran the "npm install" command.
I also tried @rkachach and this webpack-contrib/css-loader#447 (comment) answers but no one worked for me.

I found the working steps to install all of the dependencies here:

  • delete this line "prepare": "rm -rf dist && npm run build", from the package.json file
  • clear the cache, delete the package-lock.json file, and delete node_modules folder as stated here https://stackoverflow.com/a/62744648/8339172
  • run "npm install" again

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

3 participants