I have watched your video (Thank you for your great contribution on this platform) multiple times and followed closely, i think my linux idiocy is kicking in.
NPM is installed on the host Ver 10/node 18.20, which also installed a hidden folder reflecting node_modules in my root folder. I checked the content and it was exact same with the nodevenv\
Can you clarify what you mean by that?
[skillfor@server302 ~]$ nodevenv/skillforze/18/bin/npm version
{
npm: β10.5.0β,
node: β18.20.0β,
acorn: β8.10.0β,
ada: β2.7.6β,
ares: β1.27.0β,
base64: β0.5.2β,
brotli: β1.0.9β,
cjs_module_lexer: β1.2.2β,
cldr: β44.1β,
icu: β74.2β,
llhttp: β6.1.0β,
modules: β108β,
napi: β9β,
nghttp2: β1.57.0β,
openssl: β1.1.1pβ,
simdutf: β4.0.8β,
tz: β2024aβ,
undici: β5.28.3β,
unicode: β15.1β,
uv: β1.44.2β,
uvwasi: β0.0.19β,
v8: β10.2.154.26-node.36β,
zlib: β1.2.11β
If mysql2 is missing in your list of dependencies it wonβt be installed by the control panel.
Can you check your wappler local version of package.json, I would expect to see mysql2, mine specifies v 3.6.5.
what is output if you enter
nodevenv/skillforze/18/bin/npm list
via the orangehost cPanel terminal
Wappler flagged all the @ as people. It is a long list of @
What should i be looking for specifically, so that i can crop that section to you.
place the list inside 3 backticks like ` to stop that but looking for mysql2 entry
Same here!
Starting to think there is a wappler is issue here. If mysql2 is already installed why is there a process firing to reinstall?
Wappler should not be reinstalling this if already present
Due to the fact that no path is set to npm then if wappler is trying to execute a further reinstall it will, I guess, fail giving the error you see.
I will.speak with tech support and run this past George tomorrow as the condituon on which reinstall of mysql2 fires is only known to the team.
I will also see if orangehost tech support can give a solution for adding the path to npm from terminal.
Thank you sir!
We donβt and canβt run any npm installs on remote cPanel installations automatically.
So we run those only on the local development target when required.
When the new package.json file is uploaded to the remote the user should run the npm install within the cPanel self manually.
Yes, i am very confused about this also, personally i am not experiencing this problem and pages are rendering correctly but as you see @scott and @Bankym are having issues.
I will do another video illustrating the correct procedure so it is fully clarified and if that does not work i really donβt see what i can do to assist.
I have contacted orange host tech support but they have not been much help to date, they freely admit they only really support WordPress fully. I await further updates from their server team
UPDATE
-
Discussed with George who says there should not actually be any need now to install npm packages directly as they should be run from the control panel when the node.js app is initialised.
-
I will soon be releasing a video showing the method I used to install dependencies which works in my case.
-
DELIGHTED to say after discussions with Orangehost that they acknowledge that NPM should be able to be run directly from terminal without using the full path and they are roiling out an update across all their servers to fix this
For info
Zahid Rasheed Abbasi (OrangeHost)
Apr 27, 2024, 10:32 PM GMT+4
Thank you so much Brian for updating us.
We will now push this update on all of our servers now.
Thank you for being a loyal customer of OrangeHost.
Thank you for spreading good words regarding our services.
Have a great and wonderful rest of your day.
Best Regards,
Zahid Rasheed Abbasi
Manager at OrangeHost
Hopefully this will resolve issues
@Bankym did you ever resolve this? Getting this now on a fresh new node app on Orangehost.
Just found this and will see if it will help even though I've installed everything already.
Following Ben's video to install dependencies and restarted the app, still getting the message. I'll try Orangehost tech support.....
In cPanel, where you define apps, there is a button to install dependencies.
Check mysql is in the dependencies list!
Ok, I'm finally getting somewhere. The first time the node_modules folder was created, it was in the hosting root. I stopped the app, deleted that folder and ran npm install again, this time instead of creating the folder in the root, it placed a sim link to the folder in my application folder which I think it what it expects.
Then I ran npm install mysql2 --save from the terminal, and now the error is gone, but it doesn't seem to load my index.js
Do I need to change the home directory to my node folder?