Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing locally does not work, ./bin/erxes.js dev --deps fails #4867

Open
polooner opened this issue Dec 22, 2023 · 15 comments
Open

Installing locally does not work, ./bin/erxes.js dev --deps fails #4867

polooner opened this issue Dec 22, 2023 · 15 comments

Comments

@polooner
Copy link

Is your enhancement request related to a problem? Please describe.

The installation guide is a bit confusing and seems incomplete. We are told to create a dock folder with a new docker-compose.yaml file, but the same file already exists in the docker. I am not sure if I made mistakes and where, but I cannot get the project to run locally.

I followed the installation guide:
https://docs.erxes.io/quickstart/groups/mac

At #7, it says to ''run the following command'' but does not display any. I assumed it wants docker compose up, and ran that.

Running ./bin/erxes.js dev --deps throws this error:

Error: Command failed: cd /Users/polo/erxes/packages/dashboard && yarn install
/bin/sh: line 0: cd: /Users/polo/erxes/packages/dashboard: No such file or directory

So I just created a packages/dashboard folder and the following happens, pm2 errors all processes:

╰─➤  ./bin/erxes.js dev --deps                                                                        1 ↵

Generated ui coreui .env file ....
Installing dependencies in logs .........
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.50s.

warning package.json: No license field

yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.49s.


Generated ui plugins.js file ....
Installing dependencies in core-ui .........
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.52s.



                        -------------

__/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
 _\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___
  _\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__
   _\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___
    _\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____
     _\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________
      _\/\\\_____________\/\\\_____________\/\\\___/\\\/___________
       _\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_
        _\///______________\///______________\///__\///////////////__


                          Runtime Edition

        PM2 is a Production Process Manager for Node.js applications
                     with a built-in Load Balancer.

                Start and Daemonize any application:
                $ pm2 start app.js

                Load Balance 4 instances of api.js:
                $ pm2 start api.js -i 4

                Monitor in production:
                $ pm2 monitor

                Make pm2 auto-boot at server restart:
                $ pm2 startup

                To go further checkout:
                http://pm2.io/


                        -------------

[PM2] Spawning PM2 daemon with pm2_home=/Users/polo/.pm2
[PM2] PM2 Successfully daemonized
[PM2][WARN] Applications coreui, core, logs-ui, logs-api, dashboard, gateway not running, starting...
[PM2] App [coreui] launched (1 instances)
[PM2] App [core] launched (1 instances)
[PM2] App [logs-ui] launched (1 instances)
[PM2] App [logs-api] launched (1 instances)
[PM2] App [dashboard] launched (1 instances)
[PM2] App [gateway] launched (1 instances)
┌────┬──────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name         │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├────┼──────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 1  │ core         │ default     │ N/A     │ fork    │ 94003    │ 0s     │ 0    │ online    │ 5%       │ 45.8mb   │ polo     │ disabled │
│ 0  │ coreui       │ default     │ N/A     │ fork    │ 93991    │ 0s     │ 0    │ online    │ 6%       │ 46.0mb   │ polo     │ disabled │
│ 4  │ dashboard    │ default     │ N/A     │ fork    │ 94039    │ 0s     │ 0    │ online    │ 0%       │ 26.0mb   │ polo     │ disabled │
│ 5  │ gateway      │ default     │ N/A     │ fork    │ 94051    │ 0s     │ 0    │ online    │ 0%       │ 4.0mb    │ polo     │ disabled │
│ 3  │ logs-api     │ default     │ N/A     │ fork    │ 94027    │ 0s     │ 0    │ online    │ 0%       │ 28.6mb   │ polo     │ disabled │
│ 2  │ logs-ui      │ default     │ N/A     │ fork    │ 94015    │ 0s     │ 0    │ online    │ 0%       │ 30.1mb   │ polo     │ disabled │
└────┴──────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘


(base) ╭─polo@Polos-MBP ~/erxes/cli  ‹dev› 
╰─➤  pm2 list
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │
├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
│ 1  │ core               │ fork     │ 15   │ errored   │ 0%       │ 0b       │
│ 0  │ coreui             │ fork     │ 15   │ errored   │ 0%       │ 0b       │
│ 4  │ dashboard          │ fork     │ 15   │ errored   │ 0%       │ 0b       │
│ 5  │ gateway            │ fork     │ 15   │ errored   │ 0%       │ 0b       │
│ 3  │ logs-api           │ fork     │ 15   │ errored   │ 0%       │ 0b       │
│ 2  │ logs-ui            │ fork     │ 15   │ errored   │ 0%       │ 0b       │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
(base) ╭─polo@Polos-MBP ~/erxes/cli  ‹dev› 
╰─➤  pm2 restart all
Use --update-env to update environment variables
[PM2] Applying action restartProcessId on app [all](ids: [ 0, 1, 2, 3, 4, 5 ])
[PM2] [coreui](0) ✓
[PM2] [core](1) ✓
[PM2] [logs-ui](2) ✓
[PM2] [logs-api](3) ✓
[PM2] [dashboard](4) ✓
[PM2] [gateway](5) ✓
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │
├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
│ 1  │ core               │ fork     │ 16   │ stopped   │ 0%       │ 0b       │
│ 0  │ coreui             │ fork     │ 16   │ stopped   │ 0%       │ 0b       │
│ 4  │ dashboard          │ fork     │ 15   │ stopped   │ 0%       │ 0b       │
│ 5  │ gateway            │ fork     │ 15   │ stopped   │ 0%       │ 0b       │
│ 3  │ logs-api           │ fork     │ 16   │ stopped   │ 0%       │ 0b       │
│ 2  │ logs-ui            │ fork     │ 16   │ stopped   │ 0%       │ 0b       │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
(base) ╭─polo@Polos-MBP ~/erxes/cli  ‹dev› 
╰─➤  pm2 logs -f 
[TAILING] Tailing last 15 lines for [all] processes (change the value with --lines option)
/Users/polo/.pm2/pm2.log last 15 lines:
PM2        | 2023-12-22T12:43:55: PM2 log: App [gateway:5] online
PM2        | 2023-12-22T12:43:55: PM2 log: App [logs-ui:2] exited with code [1] via signal [SIGINT]
PM2        | 2023-12-22T12:43:55: PM2 log: Script /opt/homebrew/bin/yarn had too many unstable restarts (16). Stopped. "errored"
PM2        | 2023-12-22T12:43:55: PM2 log: App [coreui:0] exited with code [1] via signal [SIGINT]
PM2        | 2023-12-22T12:43:55: PM2 log: Script /opt/homebrew/bin/yarn had too many unstable restarts (16). Stopped. "errored"
PM2        | 2023-12-22T12:43:55: PM2 log: App [logs-api:3] exited with code [1] via signal [SIGINT]
PM2        | 2023-12-22T12:43:55: PM2 log: Script /opt/homebrew/bin/yarn had too many unstable restarts (16). Stopped. "errored"
PM2        | 2023-12-22T12:43:55: PM2 log: App [core:1] exited with code [1] via signal [SIGINT]
PM2        | 2023-12-22T12:43:55: PM2 log: Script /opt/homebrew/bin/yarn had too many unstable restarts (16). Stopped. "errored"
PM2        | 2023-12-22T12:43:55: PM2 log: App [dashboard:4] exited with code [1] via signal [SIGINT]
PM2        | 2023-12-22T12:43:55: PM2 log: Script /opt/homebrew/bin/yarn had too many unstable restarts (16). Stopped. "errored"
PM2        | 2023-12-22T12:43:55: PM2 log: App [gateway:5] exited with code [1] via signal [SIGINT]
PM2        | 2023-12-22T12:43:55: PM2 log: Script /opt/homebrew/bin/yarn had too many unstable restarts (16). Stopped. "errored"
PM2        | 2023-12-22T12:43:55: PM2 error: Cancelling versioning data parsing
PM2        | 2023-12-22T12:43:55: PM2 error: Cancelling versioning data parsing

/Users/polo/.pm2/logs/coreui-out.log last 15 lines:
/Users/polo/.pm2/logs/core-out.log last 15 lines:
/Users/polo/.pm2/logs/logs-ui-out.log last 15 lines:
/Users/polo/.pm2/logs/logs-api-out.log last 15 lines:
/Users/polo/.pm2/logs/dashboard-out.log last 15 lines:
/Users/polo/.pm2/logs/gateway-out.log last 15 lines:
/Users/polo/.pm2/logs/coreui-error.log last 15 lines:
0|coreui   | /opt/homebrew/Cellar/yarn/1.22.19/bin/yarn:2
0|coreui   | PREFIX="/opt/homebrew" exec "/opt/homebrew/Cellar/yarn/1.22.19/libexec/bin/yarn.js"  "$@"
0|coreui   |                        ^^^^
0|coreui   | 
0|coreui   | SyntaxError: Unexpected identifier
0|coreui   |     at internalCompileFunction (node:internal/vm:73:18)
0|coreui   |     at wrapSafe (node:internal/modules/cjs/loader:1178:20)
0|coreui   |     at Module._compile (node:internal/modules/cjs/loader:1220:27)
0|coreui   |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
0|coreui   |     at Module.load (node:internal/modules/cjs/loader:1119:32)
0|coreui   |     at Module._load (node:internal/modules/cjs/loader:960:12)
0|coreui   |     at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
0|coreui   |     at Module._compile (node:internal/modules/cjs/loader:1256:14)
0|coreui   |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
0|coreui   |     at Module.load (node:internal/modules/cjs/loader:1119:32)

/Users/polo/.pm2/logs/core-error.log last 15 lines:
1|core     | /opt/homebrew/Cellar/yarn/1.22.19/bin/yarn:2
1|core     | PREFIX="/opt/homebrew" exec "/opt/homebrew/Cellar/yarn/1.22.19/libexec/bin/yarn.js"  "$@"
1|core     |                        ^^^^
1|core     | 
1|core     | SyntaxError: Unexpected identifier
1|core     |     at internalCompileFunction (node:internal/vm:73:18)
1|core     |     at wrapSafe (node:internal/modules/cjs/loader:1178:20)
1|core     |     at Module._compile (node:internal/modules/cjs/loader:1220:27)
1|core     |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
1|core     |     at Module.load (node:internal/modules/cjs/loader:1119:32)
1|core     |     at Module._load (node:internal/modules/cjs/loader:960:12)
1|core     |     at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
1|core     |     at Module._compile (node:internal/modules/cjs/loader:1256:14)
1|core     |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
1|core     |     at Module.load (node:internal/modules/cjs/loader:1119:32)

/Users/polo/.pm2/logs/logs-ui-error.log last 15 lines:
2|logs-ui  | /opt/homebrew/Cellar/yarn/1.22.19/bin/yarn:2
2|logs-ui  | PREFIX="/opt/homebrew" exec "/opt/homebrew/Cellar/yarn/1.22.19/libexec/bin/yarn.js"  "$@"
2|logs-ui  |                        ^^^^
2|logs-ui  | 
2|logs-ui  | SyntaxError: Unexpected identifier
2|logs-ui  |     at internalCompileFunction (node:internal/vm:73:18)
2|logs-ui  |     at wrapSafe (node:internal/modules/cjs/loader:1178:20)
2|logs-ui  |     at Module._compile (node:internal/modules/cjs/loader:1220:27)
2|logs-ui  |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
2|logs-ui  |     at Module.load (node:internal/modules/cjs/loader:1119:32)
2|logs-ui  |     at Module._load (node:internal/modules/cjs/loader:960:12)
2|logs-ui  |     at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
2|logs-ui  |     at Module._compile (node:internal/modules/cjs/loader:1256:14)
2|logs-ui  |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
2|logs-ui  |     at Module.load (node:internal/modules/cjs/loader:1119:32)

/Users/polo/.pm2/logs/logs-api-error.log last 15 lines:
3|logs-api | /opt/homebrew/Cellar/yarn/1.22.19/bin/yarn:2
3|logs-api | PREFIX="/opt/homebrew" exec "/opt/homebrew/Cellar/yarn/1.22.19/libexec/bin/yarn.js"  "$@"
3|logs-api |                        ^^^^
3|logs-api | 
3|logs-api | SyntaxError: Unexpected identifier
3|logs-api |     at internalCompileFunction (node:internal/vm:73:18)
3|logs-api |     at wrapSafe (node:internal/modules/cjs/loader:1178:20)
3|logs-api |     at Module._compile (node:internal/modules/cjs/loader:1220:27)
3|logs-api |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
3|logs-api |     at Module.load (node:internal/modules/cjs/loader:1119:32)
3|logs-api |     at Module._load (node:internal/modules/cjs/loader:960:12)
3|logs-api |     at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
3|logs-api |     at Module._compile (node:internal/modules/cjs/loader:1256:14)
3|logs-api |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
3|logs-api |     at Module.load (node:internal/modules/cjs/loader:1119:32)

/Users/polo/.pm2/logs/dashboard-error.log last 15 lines:
4|dashboar | /opt/homebrew/Cellar/yarn/1.22.19/bin/yarn:2
4|dashboar | PREFIX="/opt/homebrew" exec "/opt/homebrew/Cellar/yarn/1.22.19/libexec/bin/yarn.js"  "$@"
4|dashboar |                        ^^^^
4|dashboar | 
4|dashboar | SyntaxError: Unexpected identifier
4|dashboar |     at internalCompileFunction (node:internal/vm:73:18)
4|dashboar |     at wrapSafe (node:internal/modules/cjs/loader:1178:20)
4|dashboar |     at Module._compile (node:internal/modules/cjs/loader:1220:27)
4|dashboar |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
4|dashboar |     at Module.load (node:internal/modules/cjs/loader:1119:32)
4|dashboar |     at Module._load (node:internal/modules/cjs/loader:960:12)
4|dashboar |     at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
4|dashboar |     at Module._compile (node:internal/modules/cjs/loader:1256:14)
4|dashboar |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
4|dashboar |     at Module.load (node:internal/modules/cjs/loader:1119:32)

/Users/polo/.pm2/logs/gateway-error.log last 15 lines:
5|gateway  | /opt/homebrew/Cellar/yarn/1.22.19/bin/yarn:2
5|gateway  | PREFIX="/opt/homebrew" exec "/opt/homebrew/Cellar/yarn/1.22.19/libexec/bin/yarn.js"  "$@"
5|gateway  |                        ^^^^
5|gateway  | 
5|gateway  | SyntaxError: Unexpected identifier
5|gateway  |     at internalCompileFunction (node:internal/vm:73:18)
5|gateway  |     at wrapSafe (node:internal/modules/cjs/loader:1178:20)
5|gateway  |     at Module._compile (node:internal/modules/cjs/loader:1220:27)
5|gateway  |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
5|gateway  |     at Module.load (node:internal/modules/cjs/loader:1119:32)
5|gateway  |     at Module._load (node:internal/modules/cjs/loader:960:12)
5|gateway  |     at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
5|gateway  |     at Module._compile (node:internal/modules/cjs/loader:1256:14)
5|gateway  |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
5|gateway  |     at Module.load (node:internal/modules/cjs/loader:1119:32)

Describe the solution you'd like
A clear and concise description of what you want to happen.

@fraschm1998
Copy link

I have the same issue.

@HornBlowerCruise
Copy link

I have same issue in installing at ubuntu :

/bin/sh: 1: cd: can't cd to /home/ubuntu/erxes/erxes/packages/dashboard
(node:44331) UnhandledPromiseRejectionWarning: Error: Command failed: cd /home/ubuntu/erxes/erxes/packages/dashboard && yarn install
/bin/sh: 1: cd: can't cd to /home/ubuntu/erxes/erxes/packages/dashboard

at checkExecSyncError (child_process.js:616:11)
at execSync (child_process.js:652:15)
at Command.module.exports.devCmd (/home/ubuntu/erxes/erxes/cli/commands/dev.js:196:5)

(Use node --trace-warnings ... to show where the warning was created)
(node:44331) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:44331) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@saashqdev
Copy link

saashqdev commented Jan 1, 2024

me too. In a seperate temp dir I cloned erxes again then:

git checkout dashboard-from-plugin

copied the packages/dashboard dir over to my examples/erxes/packages dir and it seemed to build ok..

@saashqdev
Copy link

Interesting, mine had an issue with the gateway not starting. I'm still tinkernig....

@saashqdev
Copy link

If I remember correctly, you need to check if the gateway docker container is running after the installation. I had issues with this. I haven't looked in a while but you may want to check the logs of the gatway container after installation.

@wchesley
Copy link

me too. In a seperate temp dir I cloned erxes again then:

git checkout dashboard-from-plugin

copied the packages/dashboard dir over to my examples/erxes/packages dir and it seemed to build ok..

I too had the same issue where the dashboard directory didn't exist, on a fresh Ubuntu 22.04 installation. The above text resolved that issue and I was able to run through the initial setup. Huge thank you to @saashqdev!

I then had issues getting the marketplace to load, #3923 helped me a bit, but doesn't provide a full resolution. I was able to piece the configs.json file together using the README in /erxes/cli dir. From what I understand, so long as the plugin files exist in /erxes/packages you can specify them in your configs.json, under the plugins array. Aside from just adding the plugin, I had to specify "ui": "local" before I saw the plugins in erxes dashboard.

@saashqdev
Copy link

saashqdev commented Feb 1, 2024

Awesome! - would you be willing to share your configs.json file?

@wchesley
Copy link

wchesley commented Feb 1, 2024

Absolutely!

{
	"jwt_token_secret": "token",
        "dashboard": {
	},
	"client_portal_domains": "",
	"elasticsearch": {},
	"redis": {
		"password": ""
	},
	"mongo": {
		"username": "",
		"password": ""
	},
	"rabbitmq": {
		"cookie": "",
		"user": "",
		"pass": "",
		"vhost": ""
	},
	"plugins": [
		{
			"name": "logs"
		},
		{
			"name": "webbuilder",
			"ui": "local"
		},
		{
			"name": "cards",
			"ui": "local"
		},
		{
			"name": "products",
			"ui": "local"
		},
		{
			"name": "segments",
			"ui": "local"
		}
	]
}

@saashqdev
Copy link

That's very cool, thanks so much...

@saashqdev
Copy link

Would anyone happen to have a db schema dump? I'm not installed atm.

@wchesley
Copy link

wchesley commented Feb 9, 2024

erxes.tar.gz

Let me know if that helps.

@saashqdev
Copy link

Ah, way cool. This really helps me out. You're a good man @wchesley

@wchesley
Copy link

wchesley commented Mar 8, 2024

@soyombo-baterdene @Anu-Ujin @munkhsaikhan

I think this issue can be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants