xpf0000 / PhpWebStudy

Powerful Web and PHP Development Environment. Support both macOS and windows
https://www.macphpstudy.com
BSD 3-Clause "New" or "Revised" License
519 stars 42 forks source link

Node Error on Start Services #82

Closed xcrap closed 2 months ago

xcrap commented 2 months ago

Everything works fine except with this error every time I start my services (Apache, PHP, Mysql).

Error: DNS Server Start Fail: Need NodeJS, Not Found NodeJS In System Env

I do have node Installed as in NODEJS it appears the version 20.10.0 installed and checked as current. I don't know if that's a specific NODE error, but since I'm not running any node services I thought it's strange.

Love the app, it's much better than MAMP just missing a Local Email Server for Testing and a NROK integration for creating Tunnels. Amazing work :)

xpf0000 commented 2 months ago

Glad you're love the app, and thank's for this feedback.

This error message is for the DNS Server service. If you do not use DNS Server, you can turn off the display of DNS Server in the settings. Then when you use quick start, it will not run the DNS Server service, and you will not get this error.

NodeJS is detected in the app by trying to load the $HOME/.bash_profile and $HOME/.zshrc files. Then use which node to detect the node

[ -s "$HOME/.bash_profile" ] && source "$HOME/.bash_profile";[ -s "$HOME/.zshrc" ] && source "$HOME/.zshrc";which node

If your NodeJS is not included in the path of the system environment variable Path. Or it is not defined in the environment variable configuration file. Then the app will not be able to find the node

Local Email Server and NROK integration will be considered for addition. You can wait for future updates

xcrap commented 2 months ago

My DNS server was disabled (not at startup but as a service), but you're right, disabling from the startup it does fix the error, it would be better if also is disabled as a service it didn't start node or ? Anyway thanks for the super fast reply and amazing software, I'm loving it and switching from MAMP. And thanks for the info about the node path's, I'm adding it to it works maybe the DNS server could be useful but I'm more into ngrok or cloudflare tunnels for exposing the domains outside because it's really useful with webhooks as well :)

Thanks a lot :)

xcrap commented 2 months ago

Need a bit of help, so I really have node installed correctly and everything.

which node returns /Users/xcrap/.nvm/versions/node/v20.10.0/bin/node I can run node in bash or zsh but it's still failing in the app with the same error, do you any idea what I may be missing?

xcrap commented 1 month ago
[ -s "$HOME/.bash_profile" ] && source "$HOME/.bash_profile";[ -s "$HOME/.zshrc" ] && source "$HOME/.zshrc";which node

Still about this, I have node running and it's detected and my paths are right and still having the same node errors, any thoughts?

xpf0000 commented 1 month ago

If you use nvm or fnm. move nvm command or fnm command to $HOME/.zshrc file eg:

nvm:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

fnm:

export PATH="/Users/x/Library/Application Support/fnm:$PATH"
eval "`fnm env`"

or just add node path to PATH env:

export PATH="node path:$PATH"

This is because the execution environment in electron is restricted. It is not the same as in terminal.

xcrap commented 1 month ago

Yeah I've added export PATH="/usr/local/bin:$PATH" to both .bash_profile and .zshrc but it makes no difference. I don't really understand what's going on under the hood but It seems I can't get it to run. But thanks anyway, I'll skip this for now, I'm using PHPWEBSTUDY (You should find another more global fancy name) as a Mamp Pro replacement after that Github Permission fix, even with Electron it's so much smoother and fast than Mamp Pro and the UI it's a charm to use :)

xpf0000 commented 1 month ago

ok. I'll look at this issues in more detail.

In fact, the APP name issue has been bothering me for a long time.

The current name of the APP is not very good, it doesn't feel like an official product name.

There are currently three ideas for name realignment

  1. Naming based on currently supported services

Currently supported services are: A(apache) C(caddy) N(nginx) P(php/postgresql) M(mysql/mariadb/mongodb/memcached) R(redis)

Like MAMP/XAMPP, etc... Consider combinations of these words

  1. Determine the name according to the purpose of the app

The main uses of the current APP are:

  1. Opening services
  2. Create web site

Maybe it can be called: WebService/DevService etc...

  1. Use a simple and memorable proper name

like Laravel Herd/Laravel Valet

Because I'm not a native English speaker. So it's a little difficult to give a proper name to the APP. If you have any suggestions, let me know. Thank's

xcrap commented 1 month ago

Yes that was the point on the name, I think option 1 is too tech and it's an old option, even MAMP sounds catch and simple. Option 2 is okay but I don't think it's catchy and it's too geeky for such a cool software, I think you should go in the direction of 3 but that is very connected with personal taste and how it sounds.

I also used a software called Codekit that enabled live reloads and other features, I liked the name, but Herb is nice, this Laravel services names are super interesting. English is also not my native language, could be something in these ranges...

Echo - Signifies the feedback loop and responsiveness in development. Pulse - Reflects the constant activity and heartbeat of web services. Vista - A pleasing view, suggesting a clear and organized development environment. Beacon - A guiding light, symbolizing clarity and direction in managing services. Fabrica - Latin for "workshop" or "fabrication," indicating creation and development. Nexus - Latin for "connection" or "binding together." This signifies integration and linking. DevLux - Combining "Dev" with "Lux" (light), symbolizing clarity and insight in development.

Of course they are very global names, maybe they could be mixed with a bit of the second option like CodeKit did, like DevBeacon or WebPulse in this kind of styles. That's something to you think about but I think it's a bit personal here, also the good thing is you only have to change the name, the app design and icon are spot on!!! :)