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 fails with "BrowserslistError" #558

Open
mercurial-moon opened this issue Dec 27, 2024 · 4 comments
Open

Build fails with "BrowserslistError" #558

mercurial-moon opened this issue Dec 27, 2024 · 4 comments

Comments

@mercurial-moon
Copy link

OS Win11
Node v22.11.0

When running command .\ng build on current master.

Following errors are generated

./src/main.ts - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/tools/babel/webpack-loader.js):
BrowserslistError: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.

./src/polyfills.ts - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/tools/babel/webpack-loader.js):
BrowserslistError: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.

./node_modules/css-loader/dist/runtime/api.js - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/tools/babel/webpack-loader.js):
BrowserslistError: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.

./node_modules/css-loader/dist/runtime/api.js - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/tools/babel/webpack-loader.js):
BrowserslistError: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.

./node_modules/css-loader/dist/runtime/noSourceMaps.js - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/tools/babel/webpack-loader.js):
BrowserslistError: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.

./node_modules/css-loader/dist/runtime/noSourceMaps.js - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/tools/babel/webpack-loader.js):
BrowserslistError: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.

./src/styles.sass?ngGlobalStyle - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/tools/babel/webpack-loader.js):
BrowserslistError: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.

@PikuZheng
Copy link
Contributor

basedir=$(dirname "$(echo "$0" | sed -e 's is a linux bash command which is not supported by windows.

@mercurial-moon
Copy link
Author

basedir=$(dirname "$(echo "$0" | sed -e 's is a linux bash command which is not supported by windows.

what do I need to change to get it to build on windows... I am following the instructions given in the readme.

@PikuZheng
Copy link
Contributor

I'm not familiar with this. sorry.

@KirbyJeff
Copy link

KirbyJeff commented Jan 10, 2025

basedir=$(dirname "$(echo "$0" | sed -e 's is a linux bash command which is not supported by windows.

what do I need to change to get it to build on windows... I am following the instructions given in the readme.

I got this to ng build to work by navigating to the metube/ui folder, and ran .\node_modules\.bin\ng build it HAS to be run in the ui folder or this error happens, and the backslash's have to be backslashes otherwise cmd, i assume that is what you are using, won't run the binary ng
Edit: now realizing you are on win11, it might not work, idk

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