Ionic Serve Command gives an error - php

I am Devolping a mobile application using ionic framework.
When I run the command ionic server, the it throws this error:
/deps/uv/src/unix/stream.c:494: uv__server_io: Assertion `events == 1' failed
Can you help?

This looks like an error with your Node. Try the following commands first to see if your errors get solved:
sudo npm install npm -g
sudo npm cache clean -f
sudo npm install node -g
This will update your NPM (Node.js' package manager) if not already updated.
If that won't work, I'd recommend a re-install:
sudo npm uninstall node
sudo apt-get purge npm
sudo apt-get install npm
sudo npm install node -g
Let me know if you face issues in the process.

Related

I get 'npm ERR! code ENOTEMPTY' error when i try to run and install npm using the terminal

I have been trying ro run
npm install && npm run dev
but i end up getting this error.
I have tried to run
npm audit fix --force
then :
sudo chmod +x node_modules/.bin/react-scripts
but i got the same error.

Laravel 9 / Bootstrap - Vite manifest not found at

New to Laravel and I am having trouble getting bootstrap going with my project. I am not sure what I'm doing wrong.
I will give steps to see if anyone can repro and advise. Thanks in advance
I started with a fresh install of Ubuntu 22.04
1. Install PHP 8.1.2:
sudo apt install -y php php-common php-cli php-gd php-mysqlnd php-curl php-intl php-mbstring php-bcmath php-xml php-zip
2. Install Composer:
sudo apt install -y curl
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin --filename=composer
3. Create Laravel Project:
composer create-project laravel/laravel --prefer-dist laravel-bootstrap
cd laravel-bootstrap
4. Install Laravel/UI & Bootstrap
composer require laravel/ui
php artisan ui bootstrap
php artisan ui bootstrap --auth
npm install
npm run dev
When I run npm run dev, I get this message :
dev
vite
file:///var/www/laravel-bootstrap/node_modules/vite/bin/vite.js:7
await import('source-map-support').then((r) => r.default.install())
^^^^^
SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
at async link (internal/modules/esm/module_job.js:42:21)
If I run php artisan serve and go to http://127.0.0.1:8000 I get the default Laravel page and it looks fine, but if I go to http://127.0.0.1:8000/login, I get a Missing Vite Manifest File error message
screenshot of error : https://i.postimg.cc/Njzn2wBp/Screenshot-from-2022-08-18-00-11-28.png
I had pretty same problem and found solution for me
here
Update npm and node versions first and install Breeze if you don't have it already.
Briefly what I've done after:
npm install --save-dev vite laravel-vite-plugin
npm install --save-dev #vitejs/plugin-vue
Then updated package.json:
"scripts": {
"build": "vite build"
}
And
npm run build
Hope it will help ;)

Docker image does not work on AWS Fargate but it does in EC2

I'm changing infrastructure on AWS and I want to use Docker (ECS) with Fargate. My Docker image is based on Ubuntu and I install all I need in it. I'm using Laravel 5.6 on NGINX running PHP 7.2. My Docker container works on my local machine and if I run ECS with EC2, however when I change to Fargate it returns NGINX 500 error. I did some tests and I know PHP is running, only when I install my Laravel app the error happens.
Since I cannot access Fargate machine I don't know how to debug. I tryied to connect NGINX with Loggly however it requires rsyslog and since I'm using Docker it cannot access Ubuntu's core. When I install and try to run it returns:
rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted
Here is my Dockerfile:
FROM ubuntu:latest
ENV BACKEND_PATH=/code/Backend
ENV FRONTEND_PATH=/code/Frontend
## Update
RUN apt-get update -y
## Upgrade
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:certbot/certbot
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get dist-upgrade -y
RUN apt-get autoremove -y
RUN apt-get update -y
## Nano
RUN apt-get install -y nano
## Timezone
RUN echo "America/Sao_Paulo" > /etc/timezone && \
apt-get install -y tzdata && \
rm /etc/localtime && \
ln -snf /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
apt-get clean
## Git
RUN apt-get install -y git
## NGINX
RUN apt-get install -y nginx
COPY ./nginx/app/sites-available /etc/nginx/sites-available
COPY ./nginx/app/sites-available /etc/nginx/sites-enabled
COPY ./nginx/sites /etc/nginx/sites
COPY ./nginx/ssl /ssl
## PHP
RUN apt-get install -y php-cli php-fpm php-curl php-mbstring
COPY ./php/php.ini /usr/local/etc/php
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install libs
RUN apt-get install -y php-zip php-mysql php-gd pngquant gifsicle jpegoptim libicu-dev g++ php-intl php-xml
## Crontab
RUN apt-get install -y cron
COPY crontab newcrontab
RUN crontab newcrontab
RUN rm newcrontab
## Supervisor
RUN apt-get install -y supervisor
COPY ./supervisord /etc/supervisor/conf.d
## Certbot
RUN apt-get install -y python-certbot-nginx
## Install apps
COPY ./code/Backend /code/Backend
COPY ./code/Frontend/dist /code/Frontend/dist
RUN cd ${BACKEND_PATH} && chmod +x composer.phar && ./composer.phar self-update && php composer.phar install
RUN chmod -Rf 777 ${BACKEND_PATH}/storage
RUN chmod -Rf 777 ${BACKEND_PATH}/resources
RUN php ${BACKEND_PATH}/artisan config:clear
RUN php ${BACKEND_PATH}/artisan passport:keys
## Run!
EXPOSE 80 443
RUN service php7.2-fpm start
CMD ["/usr/bin/supervisord"]
I think this error has something to do with permissions but without error message it's almost impossible to know what's going on... Does anyone have any ideia how I may find this out?
I figured it out. Really stupid mistake actually. When I created Fargate configurations I used a Security Group without permissions to access some AWS components so the application was unable to boot.
Check out this answer on ServerFault: https://serverfault.com/questions/691048/kernel-log-stays-empty-rsyslogd-imklog-cannot-open-kernel-log-proc-kmsg
Try running the Fargate task with the --privileged flag. You can set this flag in the AWS console per-container in the task definition. It's in the SECURITY section near the end of the container definition. Here's the full reference for container definitions.

laravel Babel's CLI commands have been moved from the babel package to the babel-cli package

I had this error in laravel executing Gulp command: "Babel's CLI commands have been moved from the babel package to the babel-cli package".
I was updating to laravel 5.3 doing again all the gulp stuff to compile css/js...
Solution was to update npm with this command:
sudo npm install npm -g
then
sudo rm -rf node_modules
sudo ppm install
and at last again
sudo gulp

Unable to install php_pgsql in AWS ElasticBeanstalk

I am trying to connect to RDS instance from EB. But I am getting this nasty error
Fatal error: Call to undefined function pg_connect()
I tried to install php_pgsql by creating packages.config file in .ebextensions folder with following content.
packages:
yum:
php56-pgsql: []
commands:
01-install-pglib:
command: "yum install -y postgresql94-libs"
02-install-pg:
command: "yum install -y php56-pgsql"
03-install-pg:
command: "service httpd restart"
But it is not working. Is there any way to install pg client for PHP in ElasticBeanstalk.
I was able to resolve this issue by following commands.
container_commands:
110-remove-pg:
command: "yum remove -y php56-pgsql"
120-install-pglib:
command: "yum install -y postgresql94-libs"
130-install-pg:
command: "yum install -y php56-pgsql"
Hope it helps someone.

Categories