Cause:
Upon trying to uninstall the NodeJS application through cPanel >> Software >> NodeJS, the system shows the following error:
ERROR: [Errno 2] No such file or directory: ‘/home/cptechs/public_html/app/.htaccess’
Reason for the Error Occurrence:
This error arises when the application directory is deleted through the command line rather than being correctly removed from the interface.
Solution:
1: Recreate the deleted application directory using the following command:
# mkdir -v /home/cptechs/public_html/app
The above example assumes the application’s directory is /home/cptechs/public_html/app. Adjust the directory path according to your application’s location, and then recreate the deleted application.
2: Generate an empty .htaccess file within the directory:
# touch /home/cptechs/public_html/app/.htaccess
3: Adjust ownership of the newly created file to the appropriate cPanel user:
# chown cptechs:cptechs /home/cptechs/public_html/app/.htaccess