redash
redash copied to clipboard
Critical error with npm run build
Issue Summary
error TS2688: Cannot find type definition file for 'jest'.
The debug log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/local/bin/npm', 'run', 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]: [email protected]
6 info lifecycle [email protected]: [email protected]
7 verbose lifecycle [email protected]: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/redash/redash-master/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
9 verbose lifecycle [email protected]: CWD: /opt/redash/redash-master
10 silly lifecycle [email protected]: Args: [
10 silly lifecycle '-c',
10 silly lifecycle 'npm run clean && npm run build:viz && NODE_ENV=production webpack'
10 silly lifecycle ]
11 silly lifecycle [email protected]: Returned: code: 2 signal: null
12 info lifecycle [email protected]: Failed to exec build script
13 verbose stack Error: [email protected] build: npm run clean && npm run build:viz && NODE_ENV=production webpack
13 verbose stack Exit status 2
13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:314:20)
13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:314:20)
13 verbose stack at maybeClose (internal/child_process.js:1022:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid [email protected]
15 verbose cwd /opt/redash/redash-master
16 verbose Linux 4.18.0-240.1.1.el8_3.x86_64
17 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "run" "build"
18 verbose node v12.20.1
19 verbose npm v6.14.11
20 error code ELIFECYCLE
21 error errno 2
22 error [email protected] build: npm run clean && npm run build:viz && NODE_ENV=production webpack
22 error Exit status 2
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
Steps to Reproduce
- pip3 install -r requirements.txt -r requirements_dev.txt
- npm install
- npm run build
Technical details:
Redash Version: the last version Browser/OS: Ubuntu 18.04 How did you install Redash: Developer Installation Guide
Hi, we are the same problem. you can see the viz-lib/package.json , Whether the dependent files are downloaded to the viz-lib/node_modules folder . if not, You should copy the dependencies in the ./node_modules directory to the viz-lib/node_modules. so you run "npm run build" , In addition, you also need to fix sql-formatter error https://discuss.redash.io/t/9-0-0-beta-developer-installation-error-cant-resolve-sql-formatter/7668 . good luck!
Which exact dependencies did you copy? Why does npm install
in viz-lib not install them.
I don't know why does npm install in viz-lib not install them. but they can find in the node_modules folder of the root directory .
try: nvm ls-remote --lts nvm install 12.21.0 nvm use 12.21.0
same question
Can anyone share steps to reproduce this error? When I use the Docker installation on MacOS everything works.
Similarly, I get this error if I clone the repo and run yarn build
(on Ubuntu 20.04):
$ yarn build
yarn run v1.22.10
$ yarn clean && yarn build:viz && NODE_ENV=production webpack
$ rm -rf ./client/dist/
$ (cd viz-lib && yarn build:babel)
$ yarn type-gen && yarn build:babel:base
$ tsc --emitDeclarationOnly
error TS2688: Cannot find type definition file for 'jest'.
The file is in the program because:
Entry point of type library 'jest' specified in compilerOptions
tsconfig.json:8:23
8 "types": ["node", "jest"],
~~~~~~
File is entry point of type library specified here.
error TS2688: Cannot find type definition file for 'node'.
The file is in the program because:
Entry point of type library 'node' specified in compilerOptions
tsconfig.json:8:15
8 "types": ["node", "jest"],
~~~~~~
File is entry point of type library specified here.
Found 2 errors.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
viz-lib
yes !!!
cd viz-lib
npm i
@rotten I'm getting the same error as you. How did you fix it?
I'm not sure I did. I don't remember now. sorry! I stopped using redash shortly after this. I'll try again later today if I get time to see if I can reproduce it or whether I managed to fix it and forgot what I did. I'd like to use redash again some day.
Redash uses yarn now instead of npm. Curious whether you see issues running yarn install
and yarn build
@susodapop I first ran yarn --frozen-lockfile
and then yarn build
which is when I got the errors mentioned by @rotten
What version of yarn are you using?
yarn --version
1.22.10
Doing yarn --frozen-lockfile
didn't actually create a node_modules
folder in the current directory. I'm not sure where it installed the packages.
Bizarre. And which version of Node?
node --version
v14.17.1
And to confirm, which directory are you in when you run these commands?
For clarity, it isn't necessary to run yarn install within the viz-lib folder. The instructions say to run them from the root of the repository.
Yes, that is what I'm trying to do. yarn
was not creating a node_modules
folder, so I did npm install
which worked 😓
Which operating system?
CentOS 7
the same error to me.
My mac is M1 Pro. And I follow this guide: https://redash.io/help/open-source/dev-guide/docker . The previous steps worked, but when I run into yarn build
, this error occured.

I have solved this problem, bros.
cd to the root folder of redash. Run the following command.
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
yarn install
yarn build
It is work like a charm.
yarn Installation continues to fail,fail usually in step2 or step3,how can i install this project?
computer system : windows 10
@mumu1349562746 none of the core team develops on Windows so we don't have much guidance here. That said, you haven't given any debugging info. Can you share what exact error you receive or what workarounds you have tried?
Similar problem, yarn Installation continues to fail.
If stumbling into any of these issues, make sure: 1) you use yarn
and not npm
; 2) you use a Node version that is compatible with the engines
definition in package.json
(I believe that recent versions of yarn will warn you about this).
I couldn't reproduce this on recent master, but please re-open if this happens again.
Hello, here again with same error from above...
Trying to install redash-10.0.0 Ubuntu 20.04 Node 12.0.0 (tried with 14.17.1 as well) Yarn 1.22.10
followed this guide https://redash.io/help/open-source/dev-guide/setup
Do someone have solution for this?
@SlavchoSpasenoski I wouldn't expect it to work with Node 12. What was the error when working with Node 14.17.1?
Btw, are you setting it up to develop Redash or just to use it?
Hello @arikfr,
Error for node 14.17.1 was: type-gen: failed to exec type-gen script (Very similar as very first post above)
But I was tried to use master repo instead version 10.0.0, and everything related to Yarn is installed without errors.
My main goal is to deploy redash 10 (or above) without docker (for use it, not develop) (It were explained by Me in discussion https://github.com/getredash/redash/discussions/5955 )
For now I successfully installed and running Redash (from master-repo) without docker on Ubuntu 20.04. works fine with local instances as data sources (tested with MySql 5.7 server)... But now facing error with REDASH_COOKIE_SECRET. It can't read it from env file. I am sure, that env file is correct filled and configured in correct path...
Mine script is following: Redash_install_withoutDocker.txt
Error that I have
To fix this, I temporary hardcoding COOKIE_SECRET in /redash/settings/init.py to successfully run redash server & workers