rialto-php / puphpeteer

A Puppeteer bridge for PHP, supporting the entire API.
MIT License
1.34k stars 204 forks source link

Keep getting Exit Code: 127 error #176

Open scottfriebel opened 2 years ago

scottfriebel commented 2 years ago

I can only seem to get the error code 127 back when trying to run Puphpeteer. [message] => The command "'/node/v16.14.2/bin/node' '/var/www/html/vendor/nesk/puphpeteer/src/get-puppeteer-version.js'" failed. Exit Code: 127(Command not found)

I'm passing the full path to node to executable_path when setting it up. I've been using /usr/local/.nvm/versions/node/v16.14.2/bin/node but I also tried copying node here /node/v16.14.2/bin. In either/both places node is owned by www-data (the user that php runs as) and has execute permissions (755).

Running '/node/v16.14.2/bin/node' '/var/www/html/vendor/nesk/puphpeteer/src/get-puppeteer-version.js' on the command line returns "5.5.0" so node is there and executable and the get-puppeteer-version script exists.

If anyone has any insight into why I'd be getting this error, that'd be great! Thanks!

Environment:

Raja-Omer-Mustafa commented 1 year ago

I am facing the same problem and the solution work for me is echo 'export PATH=$PATH:/usr/local/nvm/versions/node/v18.8.0/bin/node' >> $HOME/.bashrc source $HOME/.bashrc I install node version using nvm on ubuntu