chartbrew icon indicating copy to clipboard operation
chartbrew copied to clipboard

Unhandled 'error' event

Open pxlaue opened this issue 2 years ago • 12 comments

Hey,

I try to install chartbrew on my Debian GNU/Linux 11 (bullseye).

Node.js v19.7.0 PostgreSQL 13.9

I called npx create-chartbrew-app chartbrew

I got the following output:

`Chartbrew Setup

Please make sure you have a MySQL or PostgreSQL instance running and you have an empty database that Chartbrew can use before proceeding.

✔ What database do you use? › PostgreSQL ✔ What's the name of your database? (default: 'chartbrew') … chartbrew ✔ What's the database username? … chartbrew ✔ What's the user password? (defaults to blank) … ✔ What's your database host address? (default: 'http://localhost') … ✔ On which port is your database running? (default: '3306') … 5432

Fetching the project files...

node:events:490 throw er; // Unhandled 'error' event ^

Error: spawn /home/user/.npm/_npx/cb17eeb36439c5fa/node_modules/7zip-bin/linux/x64/7za EACCES at ChildProcess._handle.onexit (node:internal/child_process:285:19) at onErrorNT (node:internal/child_process:483:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) Emitted 'error' event on Readable instance at: at /home/user/.npm/_npx/cb17eeb36439c5fa/node_modules/node-7z/src/events.js:90:12 at ChildProcess. (/home/user/.npm/_npx/cb17eeb36439c5fa/node_modules/node-7z/src/lifecycle.js:66:42) at ChildProcess.emit (node:events:512:28) at maybeClose (node:internal/child_process:1098:16) at Socket. (node:internal/child_process:456:11) at Socket.emit (node:events:512:28) at Pipe. (node:net:316:12) { errno: -13, code: 'EACCES', syscall: 'spawn /home/user/.npm/_npx/cb17eeb36439c5fa/node_modules/7zip-bin/linux/x64/7za', path: '/home/user/.npm/_npx/cb17eeb36439c5fa/node_modules/7zip-bin/linux/x64/7za', spawnargs: [ 'x', 'chartbrew/chartbrew.zip', '-ochartbrew', '-y', '-bb3', '-bsp1' ] }

Node.js v19.7.0 ` Does anyone have any idea what went wrong?

pxlaue avatar Feb 28 '23 10:02 pxlaue

Hey @pxlaue It looks like your current Linux user doesn't have permission to create files in the folder you ran the npx command.

I suggest you create an empty folder called chartbrew and then change the permissions to allow the cli tool to set up the project:

sudo mkdir chartbrew
sudo chown your_user chartbrew

Replace your_user in the command with the user you're currently logged in on the linux machine

razvanilin avatar Feb 28 '23 10:02 razvanilin

Hey @razvanilin ,

I have checked this. The folder is in the home directory of the caller and he has all rights. I also logged in as root and executed the command. Unfortunately, I get the same error message :(

pxlaue avatar Feb 28 '23 10:02 pxlaue

I'll need to check the CLI tool to see if anything is going amiss there.

In the meantime, you can try setting the project up using git directly. You can follow the instructions starting from here: https://docs.chartbrew.com/#developing-and-extending-the-application

Very important here is to set up the Environmental variables according to the documentation. Let me know if you get stuck and I'll help ✌️

razvanilin avatar Feb 28 '23 10:02 razvanilin

Thanks @razvanilin :)

The backend is now up and running :) But the frontend crashes with:

`Starting the development server...

Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:140:10) at module.exports (/home/user/chartbrew/client/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/home/user/chartbrew/client/node_modules/webpack/lib/NormalModule.js:417:16) at handleParseError (/home/user/chartbrew/client/node_modules/webpack/lib/NormalModule.js:471:10) at /home/user/chartbrew/client/node_modules/webpack/lib/NormalModule.js:503:5 at /home/user/chartbrew/client/node_modules/webpack/lib/NormalModule.js:358:12 at /home/user/chartbrew/client/node_modules/loader-runner/lib/LoaderRunner.js:373:3 at iterateNormalLoaders (/home/user/chartbrew/client/node_modules/loader-runner/lib/LoaderRunner.js:214:10) at iterateNormalLoaders (/home/user/chartbrew/client/node_modules/loader-runner/lib/LoaderRunner.js:221:10) /home/user/chartbrew/client/scripts/start.js:11 throw err; ^

Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:140:10) at module.exports (/home/user/chartbrew/client/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/home/user/chartbrew/client/node_modules/webpack/lib/NormalModule.js:417:16) at /home/user/chartbrew/client/node_modules/webpack/lib/NormalModule.js:452:10 at /home/user/chartbrew/client/node_modules/webpack/lib/NormalModule.js:323:13 at /home/user/chartbrew/client/node_modules/loader-runner/lib/LoaderRunner.js:367:11 at /home/user/chartbrew/client/node_modules/loader-runner/lib/LoaderRunner.js:233:18 at context.callback (/home/user/chartbrew/client/node_modules/loader-runner/lib/LoaderRunner.js:111:13) at /home/user/chartbrew/client/node_modules/babel-loader/lib/index.js:59:103 { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' }

Node.js v19.7.0 `

pxlaue avatar Feb 28 '23 11:02 pxlaue

I googled the issue and it appears to be something related to webpack (the builder for the front-end) and brand new NodeJS versions.

Are you able to change the version of Node to the either one of these? v18, v16, v14 (usually the even numbers are the stable releases)

razvanilin avatar Feb 28 '23 11:02 razvanilin

That I can do.

pxlaue avatar Feb 28 '23 11:02 pxlaue

So I tried Node v18.14.2 and went in the same issue

code: 'ERR_OSSL_EVP_UNSUPPORTED'

pxlaue avatar Feb 28 '23 13:02 pxlaue

Ah forgot to mention that you need to install the node modules again since you are still using the ones installed with Node 19. So in the client folder, run these commands:

rm -rf node_modules
npm install
npm start

razvanilin avatar Feb 28 '23 13:02 razvanilin

@razvanilin I managed to get it to work with version 16.19.1.

pxlaue avatar Feb 28 '23 13:02 pxlaue

I'm getting the same error as the original post (Error: spawn /home/user/.npm/_npx/cb17eeb36439c5fa/node_modules/7zip-bin/linux/x64/7za EACCES).

I'm on macOS 12.6.3 with node v18.2.0.

TehShrike avatar Mar 07 '23 16:03 TehShrike

Hey @TehShrike the create-chartbrew-app CLI tool needs to be updated as it doesn't work properly at the moment. I suggest trying to run the app directly with the npm commands: https://github.com/chartbrew/chartbrew/issues/162#issuecomment-1447956082

razvanilin avatar Mar 07 '23 16:03 razvanilin

Marked as stale because of inactivity. Feel free to comment if you still have this issue.

github-actions[bot] avatar Feb 19 '24 12:02 github-actions[bot]