optuna / optuna-dashboard

Real-time Web Dashboard for Optuna.
https://optuna-dashboard.readthedocs.io/en/latest/
Other
477 stars 83 forks source link

Fix package-lock.json to build on Linux environment #870

Closed c-bata closed 2 months ago

c-bata commented 2 months ago

Contributor License Agreement

This repository (optuna-dashboard) and Goptuna share common code. This pull request may therefore be ported to Goptuna. Make sure that you understand the consequences concerning licenses and check the box below if you accept the term before creating this pull request.

Reference Issues/PRs

I'm not sure why but npm run watch became raising the following error on Linux environments after merging #864.

$ npm run watch

> optuna-dashboard@0.0.1 watch
> NODE_ENV=development TYPESCRIPT_LOADER=esbuild-loader webpack --watch

= = = = = = = = = = = = = = = = = = =
DEVELOPMENT BUILD
esbuild-loader
= = = = = = = = = = = = = = = = = = =
asset bundle.js 1.76 KiB [compared for emit] (name: main) 1 related asset
./ts/index.tsx 39 bytes [built] [1 error]

ERROR in ./ts/index.tsx
Module build failed (from ./node_modules/esbuild-loader/dist/index.cjs):
Error: The package "@esbuild/linux-x64" could not be found, and is needed by esbuild.

If you are installing esbuild with npm, make sure that you don't specify the
"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
of "package.json" is used by esbuild to install the correct binary executable
for your current platform.
    at generateBinPath (/home/cbata/go/src/github.com/optuna/optuna-dashboard/optuna_dashboard/node_modules/esbuild/lib/main.js:1921:15)
    at esbuildCommandAndArgs (/home/cbata/go/src/github.com/optuna/optuna-dashboard/optuna_dashboard/node_modules/esbuild/lib/main.js:1991:33)
    at ensureServiceIsRunning (/home/cbata/go/src/github.com/optuna/optuna-dashboard/optuna_dashboard/node_modules/esbuild/lib/main.js:2163:25)
    at transform (/home/cbata/go/src/github.com/optuna/optuna-dashboard/optuna_dashboard/node_modules/esbuild/lib/main.js:2049:37)
    at Object.ESBuildLoader (/home/cbata/go/src/github.com/optuna/optuna-dashboard/optuna_dashboard/node_modules/esbuild-loader/dist/index.cjs:77:33)

What does this implement/fix? Explain your changes.

Re-generate package-lock.json by rm -rf node_modules package-lock.json && npm install.