Categories
Laravel Samuel

Deploying An Old Laravel Site

When deploying an old site today we ran npm install which triggers this issue:

npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it! 

npm WARN img-loader@3.0.1 requires a peer of imagemin@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN laravel-mix-transpile-node-modules@2.0.1 requires a peer of laravel-mix@^4.0.0||^5.0.0||^6.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN v-calendar@2.3.0 requires a peer of @popperjs/core@^2.4.0 but none is installed. You must install peer dependencies yourself.

The staging server in this case had an older version of NPM installed than what our two developers were using in their local environments, so to fix this we got staging in sync with the NPM version that the developers were now using by running:

npm audit fix
npm install -g npm
Categories
Laravel Samuel

Laravel Deployment Commands

This is just a helpful reminder list of commands to run when deploying code for a Laravel project:

composer update
npm install
php artisan cache:clear
php artisan route:clear
php artisan view:clear
php artisan config:clear

when running php artisan cache:clear if you see the error:

Failed to clear cache. Make sure you have the appropriate permissions.

The data directory most likely doesn’t exist under (storage/framework/cache/data),

This data directory doesn’t exist by default on a fresh/new installation.

Creating the data directory manually at (storage/framework/cache) should fix this issue.

Categories
Laravel Mac Samuel

Fixing NPM Install Error

Ran into this error today when running NPM install on a project:

No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1

To Fix this we ran:

xcode-select --print-path
# in my case /Library/Developer/CommandLineTools

# next line deletes the path returned by the command above
sudo rm -rf $(xcode-select --print-path)

# install the tools(again) with
xcode-select --install

Source: https://stackoverflow.com/questions/60573595/npm-install-fails-on-node-gyp-rebuild-with-gyp-no-xcode-or-clt-version-detec 

Once you complete the commands above now run npm install again and live is good 🙂

Categories
Fixing Stuff Samuel Thoughts

Everyone’s Political Views Are Hypocritical

This is just a small sample list but it covers most people:

“the government should be limited and as small as possible”

“oh well except when a women wants to choose what goes on in her own body, then the government should step in there”

“the prohibition on drugs is racists and does not work, prohibitions never work”

“we need to outlaw guns! No one should be able to buy automatic weapons, just put a prohibition on them and gun violence will stop”

“our government needs to lower spending and not run deficits. We must cut expenses and balance the budget “

“We should have a blank check for military spending and fighting overseas. No cost is too high to keep our boys safe.”

  • the not as obvious hypocrisy here is two part. 1 people saying we need to cut the social safety net here in the US, while also saying we need to send citizens off to war and risk their lives. And in the next breath saying not cost is too high to keep those boys safe during war. It’s just idiotic. It’s too expensive to help US citizens out when they are living in the US, but let’s stir up a bunch of wars and waste unimaginable amounts of $ blowing things up, which literally adds 0 to the planet. Objectively building a bomb and then blowing it up and potentially also killing people with it ads at best 0 value to the world, and at worst a very net negative. We do live in a violent world, and to some degree we have to balance the fact that people will do violence to us unless we are prepared to defend ourselves. There is also a huge gab between having a military to protect ourselves, and having a military that polices the entire world and really if we are honest kills a lot of people and stirs up a lot of trouble. I will admit there is credence to the thought that if the US did not police the world there would be more violence, but at the end of the day I think we could even continue to police the world and do it in a way that was much less about the US exploiting other countries for our gain, and more about the US trying to make the world a better place. We have definitely leaned too far to the side exploiting and it really sucks because we don’t have to be that way. It does feel like it would be extremely hard to stop though. Most of our countries problems would be easy to solve, except that a large part of our population watches tons of misinformation on the news and reads tons of misinformation online. It really would be challenging to effect much change in our current environment.

“if you don’t wear a mask then a private business has the right to refuse to serve you. It’s just like no shoes, no shirt, no service.”

“oh well a private business can’t refuse service to someone on religious grounds, they need to serve everyone equally at all times”

  • the not as obvious hypocrisy here is that people are telling the religious person that their views are wrong and should be suppressed. And to be total fair I obviously see the difference between refusing someone for a safety reason, vs refusing someone for a religious reason. But I’m not religious. Religious people could very well think disobeying their god/religion is dangerous to them. And at the end of the day no one can definitively say whats real and whats not real when it comes to big picture stuff like religion. It is without a doubt 100% possible that religious people could be correct, there could be a god and they could be living the way that god wants humans to live. I find that highly unlikely, but its possible all the same.

Categories
Fixing Stuff Phase Two Samuel Sisters House

Working With My Dad

Do something that feels like play to you but looks like work to others

@naval

Thought about that quote often the past few days working on this old building with my dad, scraping caulking and re-painting these old 1904 model window frames. This kind of work is so enjoyable to me it doesn’t feel like work at all, more like a fun hobby. Add working with my dad into the mix and it’s really something special. Didn’t always have a great relationship with my dad. But he was always there and always showing me what to do, and sometimes what not to do, but still teaching me all the same. Really glad I got to work with him on this building remodel and hopefully get to keep working with him on projects for a long, long time!

Bare Wood
Bare Wood
Concrete Caulking Sill and Window Fame
Primed
Painted
Categories
Fixing Stuff Laravel Samuel

Setting Up an Old Laravel Project

Steps to setting up an old Laravel project:

First error screen:

Warning: require(/path/public/../vendor/autoload.php): failed to open stream: No such file or directory in /path/public/index.php on line 24

Fatal error: require(): Failed opening required '/path/public/../vendor/autoload.php' (include_path='.:/usr/local/Cellar/php@7.4/7.4.19/share/php@7.4/pear') in /path/public/index.php on line 24

Fix:

run: composer install

Second Error Screen:

Fix:

Download the .env file from the staging site and change it to work with the local DB

Third Error:

ErrorException (E_ERROR)
The Mix manifest does not exist. (View: /path/resources/views/layouts/app.blade.php)
(View: /path/resources/views/layouts/app.blade.php)

Fix:

To fix this we will want to run “npm install followed by npm run dev” however when we run “npm install” we get the error message incorrect or missing password. To fix this we must first do:

download the .npmrc file from staging

rm -rf node_modules
rm package-lock.json
rm yarn.lock
npm cache clear --force
npm install
composer install
npm run dev
now we can run
npm insall 
npm install --save-dev webpack
npm run dev
   type yes to install CLI for webpack