Closed AnweshGangula closed 1 year ago
Turns out the python ./build
is not able to identify the executable. I tried to debug this, but could not spend too much time on this.
Instead I ran the npm run build
script directly, but it didn't work since the parameter target
in the webpack.config.js file was being passed by the python ./build
file.
Debugging this was fairly simple
const target = env.TARGET ?? process.env.npm_config_target;
npm run build --target=chrome
in the terminal to manually pass the target and for this to workBut this isn't a solution, rather a workaround.
found the solution for the issue with ./build --chrome
. the check_call
command should specify shell = True
for the command to work properly.
check_call([
'npm', 'run', 'build',
], env=env, shell=True, cwd=str(Path(__file__).absolute().parent))
But it also points to another resource which says that for Windows, adding shell=True
is not the right approach, instead the check_call command should be:
check_call([
'npm.cmd', 'run', 'build',
], env=env, cwd=str(Path(__file__).absolute().parent))
Along with the above changes, I also had to disable the App Installer
of python.exe
and python3.exe
in the "App Execution aliases" in windows for the command py build --chrome
to work in terminal. Without the above change I got the following error:
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Reference: https://stackoverflow.com/a/68215805/6908282
I'm running the build command (
py build --chrome
) in my Windows PC and I'm getting the following error