lightningrodlabs / acorn

Built with Holochain, Acorn is an open-source, peer-to-peer project management application. It is designed and built as a scrum-alternative, Agile Development Pattern for distributed software development teams. Acorn is currently in Alpha testing phase.
https://acorn.software
100 stars 10 forks source link

npm run dev throws error #139

Closed var-che closed 2 years ago

var-che commented 2 years ago

Hi

I have cloned the project with git. I run: npm run install-deps all fine. I run: npm run dev

I get:

=============================================================================== --- PM2 development mode ------------------------------------------------------ Apps started : web-gui,electron-holochain Processes started : 2 Watch and Restart : Enabled Ignored folder : node_modules

electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory electron-holochain-1 | /usr/bin/bash: ./electron/node_modules/.bin/electron: No such file or directory web-gui-0 | > acorn@1.0.2-alpha web web-gui-0 | > cd web && ADMIN_WS_PORT=1234 APP_WS_PORT=8888 npx webpack-dev-server --config webpack.dev.js web-gui-0 | CLI for webpack must be installed. web-gui-0 | webpack-cli (https://github.com/webpack/webpack-cli) web-gui-0 | We will use "npm" to install the CLI via "npm install -D webpack-cli". web-gui-0 | Do you want to install 'webpack-cli' (yes/no):

Connoropolous commented 2 years ago

hi. I think I've encountered that before. Try removing the electron/node_modules folder, and then running npm run electron-install from the root folder. Then retry npm run dev

var-che commented 2 years ago

I did that and when I run: npm run dev this is what I get now.

=============================================================================== --- PM2 development mode ------------------------------------------------------ Apps started : web-gui,electron-holochain Processes started : 2 Watch and Restart : Enabled Ignored folder : node_modules

electron-holochain-1 | Error launching app electron-holochain-1 | Unable to find Electron app at /home/vlada/Documents/acornDev/electron electron-holochain-1 | Cannot find module '/home/vlada/Documents/acornDev/electron/dist/index.js'. Please verify that the package.json has a valid "main" entry web-gui-0 | > acorn@1.0.2-alpha web web-gui-0 | > cd web && ADMIN_WS_PORT=1234 APP_WS_PORT=8888 npx webpack-dev-server --config webpack.dev.js electron-holochain-1 | Error launching app electron-holochain-1 | Unable to find Electron app at /home/vlada/Documents/acornDev/electron electron-holochain-1 | Cannot find module '/home/vlada/Documents/acornDev/electron/dist/index.js'. Please verify that the package.json has a valid "main" entry [rundev] App electron-holochain restarted electron-holochain-1 | Error launching app electron-holochain-1 | Unable to find Electron app at /home/vlada/Documents/acornDev/electron electron-holochain-1 | Cannot find module '/home/vlada/Documents/acornDev/electron/dist/index.js'. Please verify that the package.json has a valid "main" entry [rundev] App electron-holochain restarted

Seems like with the method of installing electron that way, it did not create dist/ folder where it is the starting point for idex.js.

Connoropolous commented 2 years ago

Ok good. Now as well try this: npm run electron-tsc. Then re-run npm run dev. Sorry I will update the developer readme if it is not already saying these things.

var-che commented 2 years ago

I did that and I manage to get the electron window open. It is blank however. This is what I get as an output:

electron-holochain-1 | holochain > 1 electron-holochain-1 | libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed web-gui-0 | > acorn@1.0.2-alpha web web-gui-0 | > cd web && ADMIN_WS_PORT=1234 APP_WS_PORT=8888 npx webpack-dev-server --config webpack.dev.js web-gui-0 | CLI for webpack must be installed. web-gui-0 | webpack-cli (https://github.com/webpack/webpack-cli) web-gui-0 | We will use "npm" to install the CLI via "npm install -D webpack-cli". web-gui-0 | Do you want to install 'webpack-cli' (yes/no): electron-holochain-1 | holochain > electron-holochain-1 | holochain > ###HOLOCHAIN_SETUP### electron-holochain-1 | holochain > ###ADMIN_PORT:1234### electron-holochain-1 | holochain > ###HOLOCHAIN_SETUP_END### electron-holochain-1 | holochain > DATASTORE_PATH: /home/vlada/Documents/acornDev/user-data/databases electron-holochain-1 | holochain > KEYSTORE_PATH: /home/vlada/Documents/acornDev/user-data/keystore electron-holochain-1 | holochain > UID: None electron-holochain-1 | holochain > Recognized a keypair, using that... electron-holochain-1 | holochain > An existing configuration and identity was found, using that. electron-holochain-1 | holochain > APP_WS_PORT: 8888 electron-holochain-1 | holochain > INSTALLED_APP_ID: main-app electron-holochain-1 | holochain > EMBEDDED_HOLOCHAIN_IS_READY electron-holochain-1 | holochain > 7

Connoropolous commented 2 years ago

do View -> Reload or Cmd-R or Ctrl-R

var-che commented 2 years ago

I did that, nothing. I have checked the Developer Tools:

Request made to http://localhost:8080/ does not return anything. That is the only request that has been sent.

Connoropolous commented 2 years ago

Oh hm. It looks like what must have happened is your original npm run install-deps must have failed, since all the dependenceis seem to be missing.

Stop the process, run npm run web-install, and then re-run. You should not see the following:

web-gui-0 | CLI for webpack must be installed.
web-gui-0 | webpack-cli (https://github.com/webpack/webpack-cli)
web-gui-0 | We will use "npm" to install the CLI via "npm install -D webpack-cli".
web-gui-0 | Do you want to install 'webpack-cli' (yes/no):

Instead you should see successful webpack UI compilation logs.

Once it shows success, you can reload the application window to see the UI.

var-che commented 2 years ago

It works now!

In the terminal, I have these errors, I don't know if they are common:

web-gui-0 | ℹ 「wdm」: Compiled successfully. electron-holochain-1 | holochain stderr err > Jun 20 22:16:09.392 ERROR holochain_sqlite::db: Connection pool took 36.372281ms to be free'd electron-holochain-1 | an unhandled error occurred: Error: Jun 20 22:16:09.392 ERROR holochain_sqlite::db: Connection pool took 36.372281ms to be free'd electron-holochain-1 | at Socket. (/home/vlada/Documents/acornDev/electron/node_modules/electron-holochain/dist/src/holochain.js:194:41) electron-holochain-1 | at Socket.emit (events.js:315:20) electron-holochain-1 | at addChunk (internal/streams/readable.js:309:12) electron-holochain-1 | at readableAddChunk (internal/streams/readable.js:284:9) electron-holochain-1 | at Socket.Readable.push (internal/streams/readable.js:223:10) electron-holochain-1 | at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

Anyway, thanks for resolving the issue! I really appreciate it.

Connoropolous commented 2 years ago

Great. No that is not a real issue, the error you are seeing.

What is your interest in Acorn?

var-che commented 2 years ago

I want to learn Holochain and Acorn was recommended as one of the most mature and well-developed projects. I am going to experiment by debugging, adding new features, and debugging more. Looking forward to hdk_crud as well. I am very optimistic about the technology and right now I am just testing the waters.

Connoropolous commented 2 years ago

superb. hope I can lend a hand along the way.

var-che commented 2 years ago

And I hope that I can repay you someday. Thanks for the offer and for the help that you have provided me.