[ Laravel ] could not find driver (SQL: select * from information_schema.tables where table_schema = newsletter and table_name = migrations)

Problem

$ php artisan migrate

could not find driver (SQL: select * from information_schema.tables where table_schema = newsletter and table_name = migrations)

Solution

$ sudo apt-get install php7.1-mysql

ref : https://laracasts.com/discuss/channels/laravel/php-artisan-migrate-gives-me-an-error-could-not-find-driver?page=1#reply=308319

[ netlify ] basic authentication

Solution : use gatsby-plugin-netlify plugin to generate _headers.

plugins: [
'gatsby-plugin-netlify',
{
resolve: `gatsby-plugin-netlify`,
options: {
headers: {
'/*': [
'Basic-Auth: username:password',
],
}
},
},
],

NOTE :

 

Refused to display ‘https://newton.newtonsoftware.com/career/CareerHome.action’ in a frame because an ancestor violates the following Content Security Policy directive: “frame-ancestors https://whatever.com https://*.whatever.com http://*.whatever.com http://whatever.com”.

Console Error

Refused to display 'https://newton.newtonsoftware.com/career/CareerHome.action' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://whatever.com https://*.whatever.com http://*.whatever.com http://whatever.com".

Response Header

Content-Security-Policy: frame-ancestors https://whatever.com https://*.whatever.com http://*.whatever.com http://whatever.com

[ netlify ] error Plugin gatsby-transformer-sharp returned an error, Error: Cannot find module ‘../build/Release/sharp.node’

Problem

11:10:09 AM: $ gatsby build
11:10:12 AM: success open and validate gatsby-config — 0.007 s
11:10:12 AM: success load plugins — 0.151 s
11:10:12 AM: error Plugin gatsby-transformer-sharp returned an error
11:10:12 AM:
11:10:12 AM: Error: Cannot find module '../build/Release/sharp.node'
11:10:12 AM:
11:10:12 AM: - v8-compile-cache.js:159 require
11:10:12 AM: [repo]/[v8-compile-cache]/v8-compile-cache.js:159:20
11:10:12 AM:
11:10:12 AM: - constructor.js:10 Object.
11:10:12 AM: [repo]/[gatsby-plugin-sharp]/[sharp]/lib/constructor.js:10:15
11:10:12 AM:
11:10:12 AM: - v8-compile-cache.js:178 Module._compile
11:10:12 AM: [repo]/[v8-compile-cache]/v8-compile-cache.js:178:30
11:10:12 AM:
11:10:12 AM: - v8-compile-cache.js:159 require
11:10:12 AM: [repo]/[v8-compile-cache]/v8-compile-cache.js:159:20
11:10:12 AM:
11:10:12 AM: - index.js:3 Object.
11:10:12 AM: [repo]/[gatsby-plugin-sharp]/[sharp]/lib/index.js:3:15
11:10:12 AM:
11:10:12 AM: - v8-compile-cache.js:178 Module._compile
11:10:12 AM: [repo]/[v8-compile-cache]/v8-compile-cache.js:178:30
11:10:12 AM:
11:10:12 AM:
11:10:12 AM: error Command failed with exit code 1.

Environment

node v8.15.0 (npm v6.4.1)

yarn version 1.3.2

Solution

npm rebuild sharp gatsby-plugin-sharp gatsby-transformer-sharp

npm rebuild will rebuild the sharp library

3:32:52 PM: > sharp@0.20.8 install /opt/build/repo/node_modules/gatsby-plugin-sharp/node_modules/sharp
3:32:52 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
3:32:52 PM: info
3:32:52 PM: sharp
3:32:52 PM: Detected globally-installed libvips v8.6.2
3:32:52 PM: info sharp
3:32:52 PM: Building from source via node-gyp
3:32:53 PM: make: Entering directory `/opt/build/repo/node_modules/gatsby-plugin-sharp/node_modules/sharp/build'
3:32:53 PM: TOUCH Release/obj.target/libvips-cpp.stamp
3:32:53 PM: CXX(target) Release/obj.target/sharp/src/common.o
3:32:55 PM: CXX(target) Release/obj.target/sharp/src/metadata.o
3:32:57 PM: CXX(target) Release/obj.target/sharp/src/stats.o
3:32:58 PM: CXX(target) Release/obj.target/sharp/src/operations.o
3:33:00 PM: CXX(target) Release/obj.target/sharp/src/pipeline.o
3:33:03 PM: CXX(target) Release/obj.target/sharp/src/sharp.o
3:33:04 PM: CXX(target) Release/obj.target/sharp/src/utilities.o
3:33:06 PM: SOLINK_MODULE(target) Release/obj.target/sharp.node
3:33:06 PM: COPY Release/sharp.node
3:33:06 PM: make: Leaving directory `/opt/build/repo/node_modules/gatsby-plugin-sharp/node_modules/sharp/build'
3:33:06 PM: > sharp@0.20.8 install /opt/build/repo/node_modules/gatsby-transformer-sharp/node_modules/sharp
3:33:06 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
3:33:07 PM: info
3:33:07 PM: sharp Detected globally-installed libvips v8.6.2
3:33:07 PM: info sharp Building from source via node-gyp
3:33:07 PM: make: Entering directory `/opt/build/repo/node_modules/gatsby-transformer-sharp/node_modules/sharp/build'
3:33:07 PM: TOUCH Release/obj.target/libvips-cpp.stamp
3:33:07 PM: CXX(target) Release/obj.target/sharp/src/common.o
3:33:09 PM: CXX(target) Release/obj.target/sharp/src/metadata.o
3:33:11 PM: CXX(target) Release/obj.target/sharp/src/stats.o
3:33:12 PM: CXX(target) Release/obj.target/sharp/src/operations.o
3:33:14 PM: CXX(target) Release/obj.target/sharp/src/pipeline.o
3:33:17 PM: CXX(target) Release/obj.target/sharp/src/sharp.o
3:33:18 PM: CXX(target) Release/obj.target/sharp/src/utilities.o
3:33:19 PM: SOLINK_MODULE(target) Release/obj.target/sharp.node
3:33:19 PM: COPY Release/sharp.node
3:33:19 PM: make: Leaving directory `/opt/build/repo/node_modules/gatsby-transformer-sharp/node_modules/sharp/build'
3:33:20 PM: > sharp@0.21.0 install /opt/build/repo/node_modules/sharp
3:33:20 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
3:33:20 PM: info
3:33:20 PM: sharp
3:33:20 PM: Using existing vendored libvips v8.7.0
3:33:21 PM: make: Entering directory `/opt/build/repo/node_modules/sharp/build'
3:33:21 PM: TOUCH Release/obj.target/libvips-cpp.stamp
3:33:21 PM: CXX(target) Release/obj.target/sharp/src/common.o
3:33:23 PM: CXX(target) Release/obj.target/sharp/src/metadata.o
3:33:24 PM: CXX(target) Release/obj.target/sharp/src/stats.o
3:33:26 PM: CXX(target) Release/obj.target/sharp/src/operations.o
3:33:27 PM: CXX(target) Release/obj.target/sharp/src/pipeline.o
3:33:31 PM: CXX(target) Release/obj.target/sharp/src/sharp.o
3:33:32 PM: CXX(target) Release/obj.target/sharp/src/utilities.o
3:33:33 PM: SOLINK_MODULE(target) Release/obj.target/sharp.node
3:33:33 PM: COPY Release/sharp.node
3:33:33 PM: make: Leaving directory `/opt/build/repo/node_modules/sharp/build'
3:33:33 PM: gatsby@2.0.118 /opt/build/repo/node_modules/gatsby

ref : ref : https://discuss.circleci.com/t/error-the-module-sharp-was-compiled-against-a-different-node-js-version/19854

[ Netlify ] Notification to slack

Build & Deploy

  • Add deploy notifications as pull request comments when deploy succeeds

Setup : GitHub pull request comment >

Event to listen for : Deploy succeeded

  • Send message to Slack when deploy starts/succeeds/fails/is locked/is unlocked

Setup : Slack integration >

Event to listen for : Deploy started/Deploy succeeded/Deploy failed/Deploy locked/Deploy unlocked

Slack Incoming Webhook URL : URL from webhook ( ref : https://api.slack.com/incoming-webhooks )