mumble-web icon indicating copy to clipboard operation
mumble-web copied to clipboard

Build error on Windows

Open rkachach opened this issue 4 years ago • 5 comments

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! [email protected] prepare: `rm -rf dist && npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

rkachach avatar Oct 29 '20 14:10 rkachach

I had not test it, but it should works:

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

joker-x avatar Oct 29 '20 14:10 joker-x

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?

rkachach avatar Oct 29 '20 15:10 rkachach

Here https://github.com/webpack-contrib/css-loader/issues/447#issuecomment-606542351 recommend to use

target: 'node',

instead of fs:'empty'

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

joker-x avatar Oct 29 '20 15:10 joker-x

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

rkachach avatar Oct 29 '20 18:10 rkachach

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 https://github.com/webpack-contrib/css-loader/issues/447#issuecomment-606542351 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

jaballogian avatar Jan 12 '23 02:01 jaballogian