superset: "npm run build" fails

We are trying to build superset in production mode, but it fails.

Expected results

We expect npm run build to succeed.

Actual results

It fails.

Screenshots

$ npm run build

> superset@0.999.0-dev build /home/.../incubator-superset/superset-frontend
> cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors

Starting type checking service...
Using 1 worker with 2048MB memory limit
92% chunk asset optimization OptimizeCssAssetsWebpackPluginBrowserslist: caniuse-lite is outdated. Please run next command `npm update`
92% chunk asset optimization TerserPluginnpm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! superset@0.999.0-dev build: `cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the superset@0.999.0-dev build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.../.npm/_logs/2020-06-16T13_54_45_886Z-debug.log

Unfortunately the logs don’t give much help either.

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/home/.../.nvm/versions/node/v12.16.3/bin/node',
1 verbose cli   '/home/.../.nvm/versions/node/v12.16.3/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v12.16.3
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle superset@0.999.0-dev~prebuild: superset@0.999.0-dev
6 info lifecycle superset@0.999.0-dev~build: superset@0.999.0-dev
7 verbose lifecycle superset@0.999.0-dev~build: unsafe-perm in lifecycle true
8 verbose lifecycle superset@0.999.0-dev~build: PATH: /home/.../.nvm/versions/node/v12.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/.../incubator-superset/superset-frontend/node_modules/.bin:/home/.../venv/bin:/home/.../.local/bin:/home/.../.nvm/versions/node/v12.16.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle superset@0.999.0-dev~build: CWD: /home/.../incubator-superset/superset-frontend
10 silly lifecycle superset@0.999.0-dev~build: Args: [
10 silly lifecycle   '-c',
10 silly lifecycle   'cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors'
10 silly lifecycle ]
11 silly lifecycle superset@0.999.0-dev~build: Returned: code: 1  signal: null
12 info lifecycle superset@0.999.0-dev~build: Failed to exec build script
13 verbose stack Error: superset@0.999.0-dev build: `cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/home/.../.nvm/versions/node/v12.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:310:20)
13 verbose stack     at ChildProcess.<anonymous> (/home/.../.nvm/versions/node/v12.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:310:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid superset@0.999.0-dev
15 verbose cwd /home/.../incubator-superset/superset-frontend
16 verbose Linux 5.4.0-37-generic
17 verbose argv "/home/.../.nvm/versions/node/v12.16.3/bin/node" "/home/.../.nvm/versions/node/v12.16.3/bin/npm" "run" "build"
18 verbose node v12.16.3
19 verbose npm  v6.14.5
20 error code ELIFECYCLE
21 error errno 1
22 error superset@0.999.0-dev build: `cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors`
22 error Exit status 1
23 error Failed at the superset@0.999.0-dev build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

How to reproduce the bug

  1. Clone repository (we tried both master and 0.36 branches separately)
  2. Go to incubator-superset/superset-frontend
  3. Run npm i
  4. Run npm run build
  5. See error

Environment

  • superset version: latest
  • python version: 3.8.2
  • node.js version: 12.16.3
  • npm version: 6.14.5

Checklist

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven’t found one similar.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

I also failed to compile, The lastest commit on Master branch.

$ git lg
* a6390afb8 - (HEAD -> master, upstream/master) style: push bootstrap theme towards SIP-34 styles (#10056) (5 hours ago) <Maxime Beauchemin>
* 8e23d4f36 - chore: Upgrade pylint to 2.5.3 and fix most new rules (#10101) (6 hours ago) <Will Barrett>
* 02fee3531 - (origin/master, origin/HEAD) chore(metricoption): remove metricoption and columntypelable dependency (#10077) (24 hours ago) <Phillip Kelley-Dotson>
* 817b7aaf2 - style: Change logo color to new branding (#10090) (24 hours ago) <Will Barrett>


$ python --version
Python 3.6.8

$ node --version
v12.18.1

$ npm --version
6.14.5

$ uname -a
Darwin Yongjie-Zhaos-MacBook-Pro.local 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar  4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64 i386 MacBookPro11,4 Darwin

$ npm run build
ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/Filters.tsx
ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/Filters.tsx(149,11):
TS2322: Type '{ label: string; value: string; }' is not assignable to type 'ValueType<GroupType<GroupType<never>>>'.
  Property 'options' is missing in type '{ label: string; value: string; }' but required in type 'GroupType<GroupType<never>>'.

ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/Filters.tsx
ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/Filters.tsx(150,11):
TS2322: Type '(selected: SelectOption | null) => void' is not assignable to type '(value: ValueType<GroupType<GroupType<never>>>, action: ActionMeta<GroupType<GroupType<never>>>) => void'.
  Types of parameters 'selected' and 'value' are incompatible.
    Type 'ValueType<GroupType<GroupType<never>>>' is not assignable to type 'SelectOption | null'.
      Type 'undefined' is not assignable to type 'SelectOption | null'.

ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/Filters.tsx
ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/Filters.tsx(151,11):
TS2322: Type '(inputValue: string, loadedOptions: SelectOption[], { page }: { page: number; }) => Promise<{ options: { label: string; value: string; }[]; hasMore: boolean; additional: { page: number; }; }>' is not assignable to type 'LoadOptions<GroupType<GroupType<never>>, any>'.
  Types of parameters 'loadedOptions' and 'options' are incompatible.
    Type 'OptionsList<GroupType<GroupType<never>>>' is not assignable to type 'SelectOption[]'.
      The type 'OptionsType<GroupType<GroupType<never>>>' is 'readonly' and cannot be assigned to the mutable type 'SelectOption[]'.

ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/TableCollection.tsx
ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/TableCollection.tsx(53,29):
TS2339: Property 'hidden' does not exist on type 'HeaderGroup<{}>'.

ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/TableCollection.tsx
ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/TableCollection.tsx(56,28):
TS2339: Property 'sortable' does not exist on type 'HeaderGroup<{}>'.

ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/TableCollection.tsx
ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/TableCollection.tsx(61,27):
TS2339: Property 'sortable' does not exist on type 'HeaderGroup<{}>'.

ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/TableCollection.tsx
ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/TableCollection.tsx(86,33):
TS2339: Property 'hidden' does not exist on type 'ColumnInstance<{}>'.

ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/TableCollection.tsx
ERROR in /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/src/components/ListView/TableCollection.tsx(88,53):
TS2339: Property 'cellProps' does not exist on type 'ColumnInstance<{}>'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! superset@0.999.0-dev build: `cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the superset@0.999.0-dev build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/yongjie.zhao/.npm/_logs/2020-06-19T03_09_38_635Z-debug.log

npm debug log.

(incubator-superset) yongjie.zhao@:superset-frontend$ cat /Users/yongjie.zhao/.npm/_logs/2020-06-19T03_09_38_635Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/Users/yongjie.zhao/.nvm/versions/node/v12.18.1/bin/node',
1 verbose cli   '/Users/yongjie.zhao/.nvm/versions/node/v12.18.1/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v12.18.1
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle superset@0.999.0-dev~prebuild: superset@0.999.0-dev
6 info lifecycle superset@0.999.0-dev~build: superset@0.999.0-dev
7 verbose lifecycle superset@0.999.0-dev~build: unsafe-perm in lifecycle true
8 verbose lifecycle superset@0.999.0-dev~build: PATH: /Users/yongjie.zhao/.nvm/versions/node/v12.18.1/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend/node_modules/.bin:/Users/yongjie.zhao/.virtualenvs/incubator-superset/bin:/Users/yongjie.zhao/Downloads/google-cloud-sdk/bin:/Users/yongjie.zhao/.nvm/versions/node/v12.18.1/bin:/Users/yongjie.zhao/.pyenv/plugins/pyenv-virtualenvwrapper/shims:/Users/yongjie.zhao/.pyenv/libexec:/Users/yongjie.zhao/.pyenv/plugins/python-build/bin:/Users/yongjie.zhao/.pyenv/plugins/pyenv-virtualenvwrapper/bin:/Users/yongjie.zhao/.pyenv/plugins/pyenv-virtualenv/bin:/Users/yongjie.zhao/.pyenv/plugins/pyenv-update/bin:/Users/yongjie.zhao/.pyenv/plugins/pyenv-installer/bin:/Users/yongjie.zhao/.pyenv/plugins/pyenv-doctor/bin:/Users/yongjie.zhao/.pyenv/shims:/Users/yongjie.zhao/.pyenv/bin:/usr/local/opt/grep/libexec/gnubin:/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/opt/go/libexec/bin:/Users/yongjie.zhao/go/bin:/usr/local/sbin:/usr/local/opt/openssl@1.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/opt/X11/bin:/Applications/Wireshark.app/Contents/MacOS
9 verbose lifecycle superset@0.999.0-dev~build: CWD: /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend
10 silly lifecycle superset@0.999.0-dev~build: Args: [
10 silly lifecycle   '-c',
10 silly lifecycle   'cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors'
10 silly lifecycle ]
11 silly lifecycle superset@0.999.0-dev~build: Returned: code: 2  signal: null
12 info lifecycle superset@0.999.0-dev~build: Failed to exec build script
13 verbose stack Error: superset@0.999.0-dev build: `cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/Users/yongjie.zhao/.nvm/versions/node/v12.18.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (/Users/yongjie.zhao/.nvm/versions/node/v12.18.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid superset@0.999.0-dev
15 verbose cwd /Users/yongjie.zhao/workspace/kyligence/incubator-superset/superset-frontend
16 verbose Darwin 19.4.0
17 verbose argv "/Users/yongjie.zhao/.nvm/versions/node/v12.18.1/bin/node" "/Users/yongjie.zhao/.nvm/versions/node/v12.18.1/bin/npm" "run" "build"
18 verbose node v12.18.1
19 verbose npm  v6.14.5
20 error code ELIFECYCLE
21 error errno 2
22 error superset@0.999.0-dev build: `cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors`
22 error Exit status 2
23 error Failed at the superset@0.999.0-dev build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

Hi @willbarrett , sure, I have installed Ubuntu Server 20.04 inside a VMWare, with 4 CPUs, 4 GB of RAM, and 30 GB of hard disk space.

Make sure everything essential is installed :

$ sudo apt install install docker docker-compose build-essential libssl-dev libffi-dev python3-dev python3-pip python3-venv libsasl2-dev libldap2-dev

Then install NodeJS

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
$ . .bashrc
$ nvm install v12
$ node --version
v12.18.0

(Note: version may change, but will be 12.x)

Then create your Python3 virtual environment, and activate it :

$ python3 -m venv venv
$ . venv/bin/activate
$ python --version
Python 3.8.2

(Note: Python version may change, but it will be 3.x)

After that, simply clone this repository and start it :

$ git clone https://github.com/apache/incubator-superset.git
$ cd incubator-superset
$ sudo docker-compose up -d

Wait for a ton load of output, and you’ll have superset up and running on your VM’s IP address on port 8088. Make sure your VM’s network adapter is configured to expose it to your local network. You can check the VM’s IP address with :

$ ip a
...
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.162.130/24 brd 192.168.162.255 scope global dynamic ens33
       valid_lft 1485sec preferred_lft 1485sec
    inet6 fe80::20c:29ff:fefc:e2cd/64 scope link 
       valid_lft forever preferred_lft forever

(Note: you don’t really need NodeJS until you want to build Superset locally. With NodeJS installed, you can go into the superset frontend and build it :

$ cd superset-frontend
$ npm ci
$ npm run build

This last command is what fails for me.

As for the rest, I’ll leave it up to you to discover and set it up. Please, do share your findings.

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.89. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.