Laravel Homestead is stuck at running npm install - laravel

I've installed Laravel Homestead recently, but when I try to run npm install it gets stuck at building the babel package.
Line where it get's stuck: build:#babel/helper-validator-option: sill linkStuff #babel/helper-validator-option#7.12.11 has /home/vagrant/code/testsite/node_modules as its parent node_modules
Installing a single package like VueJS works fine.
I'm using NFS on Windows right now for syncing the folders.
Versions:
Vagrant: 2.2.14
Homestead: 10.1.1
Windows 10
Kind Regards,
Corné

If you are using your Office wifi. Your office Network is blocking your proxy. That is why you are stuck.
Switch to another Wifi and maybe connect your VPN(if you are doing it on your office computer)

Related

Why does Dusk show error "This site can't be reached" ERR_CONNECTION_REFUSED after my Homestead upgrade?

I've enjoyed Laravel, Homestead, and Dusk for years. Everything was working fine, but I recently needed to upgrade to PHP 7.4 for a new package I wanted to install, so I went ahead and upgraded VirtualBox, Vagrant, etc to:
vboxmanage --version = 6.1.2r135662
Vagrant 2.2.7
laravel/homestead (virtualbox, 9.2.0)
Homestead v10.2.0
Laravel 6.13.1
Dusk v5.9.0
Ubuntu 18.04.3 LTS
PHP 7.4.1
Windows 10 is the host
Now, when I run my Dusk browser tests, they produce screenshots with this error in Chrome: "This site can't be reached" ERR_CONNECTION_REFUSED
But in Windows Chrome, I can browse to my local site fine, as usual (Windows is the host of my Homestead box).
My APP_URL in .env is (and has always been) APP_URL=https://abc.192.168.1.105.xip.io:44300, and it's the same in my .env.dusk.local file, which I've always had.
In Vagrant, when I run wget https://abc.192.168.1.105.xip.io:44300, the result says failed: Connection refused. But if I run wget 127.0.0.1, it downloads the correct page.
So then I figured I could change my APP_URL to 127.0.0.1 (although I wouldn't know why my upgrades would lead me to be required to make that change).
However, then the error in the Dusk Chrome screenshot becomes "Your connection is not private" NET::ERR_CERT_AUTHORITY_INVALID.
I have not found the docs at https://laravel.com/docs/6.x/dusk#installation to help with these problems. Ideas?
P.S. If I change to APP_URL=https://google.com, the screenshot successfully shows Google. So at least Chrome is installed properly in Homestead.
I got it working. I don't understand why these steps seem to be necessary since they were never necessary in my prior experience using Dusk, and no documentation mentioned them as newly necessary due to recent upgrades.
I removed ":44300", so now my .env.dusk.local says APP_URL=https://abc.192.168.1.105.xip.io
Then, running Dusk led to the "Your connection is not private" NET::ERR_CERT_AUTHORITY_INVALID error again, so I figured I needed to tell the Homestead Chrome browser to trust the self-signed certificate. https://stackoverflow.com/a/49612084/470749 and https://stackoverflow.com/a/22813705/470749 led me to run:
sudo apt-get install libnss3-tools
vagrant#vboxHomestead:~/Code/myproject$ cat /etc/nginx/ssl/ca.homestead.vboxHomestead.crt > ca.homestead.vboxHomestead.crt
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "ca.homestead.vboxHomestead.crt" -i ca.homestead.vboxHomestead.crt
Now Dusk runs again.

Hyperledger Composer - Angular App Compile

I spun up an Ubuntu server on AWS and everything is working as expected with Hyperledger Composer except when I try to compile an angular-app using "npm start" after creating the app via "yo hyperledger-composer:angular". Its taking forever to compile at 92% chunk asset optimization. When I do the same exact steps on my local mac laptop, no issues at all. Must be some sort of version issue with something in the node_modules? Any thoughts or suggestions?
probably because your AWS VM instance is behind a proxy - ie its network interface doesn't know how to route to www and specifically to https://registry.npmjs.org/ for example as its trying to install packages when you do an npm install

404 - Not Found when I try to browse to my local WebServer using the IP

So I'm developing responsive websites and obviously need to test these via phones and tablets and it used to work fine, up until yesterday, after I tried installing js frameworks like npm.
For some reason, when I browse to my local testing using the ip it get:
404 - Not Found
I've been used to using:
http://192.168.0.2/filename.php
I've tried:
http://192.168.0.2:8080/filename.php
...still get 404 - Not Found
I've restarted Apache and checked the the port is correct, and it is.
Listen 80
This happened before when I installed Laravel and Valet, but not long after that I had to wipe my Mac due to work and it started working again with a fresh install.
Am I missing something in Apache? does npm and Laravel mess with the Apache settings?
Locally, everything works fine. I can browse to localhost/filename.php directly using Mac with PHP and MySQL talking to each other, albeit after using Homebrew to install MySQL, PHP connections now only accepts 127.0.0.1 rather than localhost.
I've set all the permissions to "everyone" there should be no access issues.
I've noticed another oddity with Firefox Dev Ed too. When I've been using Valet or Gulp, it stops connecting and give a Cannt connect to server error, but Safari and Chrome seem to work ok.
If anyone can shed some light on this, I'd be happy to give it a go!
All fixed! It was Larvel's Valet installation that was causing the issue, as suspected.
So, looked at the brew Cellar directory in /usr/local/Cellar, but it wasn't actually in there. Then opened up Terminal and typed:
valet install
Then ran valet by typing:
valet
Then uninstalled valet by typing:
uninstalled valet
Then restarted Apache2 by typing:
sudo apachectl restart
adding password
Booted up the browser and browsed to localhost/info.php which holds the line <?php phpinfo() ?> and HAPPY DAYS :)

What is the benefit of using vagrant in Laravel?

What is the benefit of using Vagrant (via homestead) instead of using WAMP server on Microsoft Windows?
I found that configuring homestead and vagrant is harder than installing WAMP. Isn't it?
Laravel Vagrant is a homestead for development environment.
Its easy to install server requirements and including many dependencies in out command.
Ubuntu 14.04
PHP 5.6
HHVM
Nginx
MySQL
Postgres
Node (With Bower, Grunt, and Gulp)
Redis
Memcached
Beanstalkd
Laravel Envoy
Fabric + HipChat Extension
You don't needs to spend your time for configuring web server locally for this.
I think in windows better is Wamp, but in case of Ububtu and Mac, the Vagrant (Homestead) is better than others...

Laravel installed but confusion remains

I have ubuntu 14.04 and LAMPP is installed. I was learning Laravel 4, but get a lot of confusion on it's documentation, below I list few of issue.
How to install laravel?
what I did :
copy github repository into /opt/lampp/htdocs/larva and run composer install, Laravel is installed and I can access it with http://localhost/larva
What is homestead? is that another way to install laravel or this is additional thing?
What is artisan? if I use artisan then do we need to use homestead also?
what I did ( in terminal )
cd /opt/lampp/htdocs/larva
php artisan serve
it started the service and I can access laravel with htpp://localhost:8000 BUT if i close this terminal then URL is lost
and there is one other way is using vagrant? do we need to use vagrant if we installed it already?
one more thing is Nginx?
overall these vagrant, Nginx, Homestead, artisan,and composer methods create such a mess.
Please clear the clouds and please do not mention what is vagrant Nginx and all. I just want to know that do I need to do something with Homestead and vagrant if i have installed using git repository and composer way?
Thanks
Laravel Homestead is an official, pre-packaged Vagrant "box" that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine.
Artisan is the name of the command-line interface included with Laravel. It provides a number of helpful commands for your use while developing your application. It is driven by the powerful Symfony Console component.
When you close the terminal, you are stopping the service on port 8000. You always can create a virtual host, and point its root to your larval installation /public directory
you dont have to use vagrant to run laravel. Vagrant is just your 'bridge' to Virtual Mashine.
If you installed LAravel via composer and you got it work on localhost:8000 then you dont need neither homestead or vagrant

Resources