Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to deploy my gatsby(node) blog to Gitlab #13924

Closed
AbhimanyuAryan opened this issue May 8, 2019 · 6 comments
Closed

Unable to deploy my gatsby(node) blog to Gitlab #13924

AbhimanyuAryan opened this issue May 8, 2019 · 6 comments
Labels
status: awaiting author response Additional information has been requested from the author

Comments

@AbhimanyuAryan
Copy link

I have gatsby blog that I'm trying to host on Gitlab but I get deployment error. I tried adding rm -R /public /node_modules under script section in .gitlab-ci.yml but it didn't work

My .gitlab-ci.yml file

image: node:latest

# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
  paths:
    - node_modules/

pages:
  script:
    - npm install
    - ./node_modules/.bin/gatsby build --prefix-paths
  artifacts:
    paths:
      - public
  only:
    - master

When I commit my code to Gitlab. It doens't deploy my blog. I get the below error. Earlier it was working though

Checking out cd287bf3 as master...

Skipping Git submodules setup
Checking cache for default...
FATAL: file does not exist                         
Failed to extract cache
$ npm install

> [email protected] install /builds/abhimanyuaryan/abhimanyuaryan.gitlab.io/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.1.0 runtime=node arch=x64 libc= platform=linux)
make: Entering directory '/builds/abhimanyuaryan/abhimanyuaryan.gitlab.io/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
In file included from /usr/include/c++/6/cassert:44:0,
                 from /root/.node-gyp/12.1.0/include/node/node_object_wrap.h:26,
                 from ../../nan/nan.h:55,
                 from ../src/common.cc:24:
../../nan/nan_object_wrap.h: In destructor 'virtual Nan::ObjectWrap::~ObjectWrap()':
../../nan/nan_object_wrap.h:24:25: error: 'class Nan::Persistent<v8::Object>' has no member named 'IsNearDeath'
     assert(persistent().IsNearDeath());
                         ^
../../nan/nan_object_wrap.h: In static member function 'static void Nan::ObjectWrap::WeakCallback(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)':
../../nan/nan_object_wrap.h:127:26: error: 'class Nan::Persistent<v8::Object>' has no member named 'IsNearDeath'
     assert(wrap->handle_.IsNearDeath());
                          ^
In file included from ../src/common.cc:27:0:
../src/common.h: At global scope:
../src/common.h:78:16: error: 'Handle' is not a member of 'v8'
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                ^~
../src/common.h:78:37: error: expected primary-expression before '>' token
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                     ^
../src/common.h:78:39: error: 'obj' was not declared in this scope
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                       ^~~
../src/common.h:78:56: error: expected primary-expression before 'attr'
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                                        ^~~~
../src/common.h:78:60: error: expression list treated as compound expression in initializer [-fpermissive]
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                                            ^
../src/common.h:79:25: error: 'Handle' is not a member of 'v8'
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                         ^~
../src/common.h:79:46: error: expected primary-expression before '>' token
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                                              ^
../src/common.h:79:48: error: 'obj' was not declared in this scope
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                                                ^~~
../src/common.h:79:65: error: expected primary-expression before 'attr'
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                                                                 ^~~~
../src/common.h:80:34: error: 'Handle' is not a member of 'v8'
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                                  ^~
../src/common.h:80:55: error: expected primary-expression before '>' token
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                                                       ^
../src/common.h:80:57: error: 'obj' was not declared in this scope
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                                                         ^~~
../src/common.h:80:74: error: expected primary-expression before 'attr'
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                                                                          ^~~~
../src/common.h:81:44: error: 'Handle' is not a member of 'v8'
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                            ^~
../src/common.h:81:65: error: expected primary-expression before '>' token
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                 ^
../src/common.h:81:67: error: 'obj' was not declared in this scope
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                   ^~~
../src/common.h:81:84: error: expected primary-expression before 'attr'
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                                    ^~~~
../src/common.h:81:37: warning: variable templates only available with -std=c++14 or -std=gnu++14
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                     ^~~~~~
../src/common.h:81:90: error: expected ';' before '{' token
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                                          ^
../src/common.h:84:33: error: 'Handle' is not a member of 'v8'
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                 ^~
../src/common.h:84:54: error: expected primary-expression before '>' token
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                                      ^
../src/common.h:84:56: error: 'obj' was not declared in this scope
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                                        ^~~
../src/common.h:84:73: error: expected primary-expression before 'attr'
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                                                         ^~~~
../src/common.h:84:26: warning: variable templates only available with -std=c++14 or -std=gnu++14
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                          ^~~~~~
../src/common.h:84:79: error: expected ';' before '{' token
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                                                               ^
../src/common.h:87:33: error: 'Handle' is not a member of 'v8'
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                 ^~
../src/common.h:87:54: error: expected primary-expression before '>' token
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                                      ^
../src/common.h:87:56: error: 'obj' was not declared in this scope
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                                        ^~~
../src/common.h:87:61: error: expected primary-expression before 'int'
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                                             ^~~
../src/common.h:84:26: warning: variable templates only available with -std=c++14 or -std=gnu++14
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                          ^~~~~~
../src/common.h:87:71: error: expected ';' before '{' token
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                                                       ^
../src/common.h:93:5: error: 'Handle' is not a member of 'v8'
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
     ^~
../src/common.h:93:26: error: expected primary-expression before '>' token
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                          ^
../src/common.h:93:28: error: 'input' was not declared in this scope
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                            ^~~~~
../src/common.h:93:70: error: expected primary-expression before '&' token
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                                                                      ^
../src/common.h:93:71: error: 'buffersToPersist' was not declared in this scope
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                                                                       ^~~~~~~~~~~~~~~~
../src/common.h:93:87: error: expression list treated as compound expression in initializer [-fpermissive]
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                                                                                       ^
../src/common.cc:34:20: error: redefinition of 'bool sharp::HasAttr'
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                    ^~~~~~
In file included from ../src/common.cc:27:0:
../src/common.h:78:8: note: 'bool sharp::HasAttr' previously defined here
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
        ^~~~~~~
../src/common.cc:34:16: error: 'Handle' is not a member of 'v8'
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                ^~
../src/common.cc:34:37: error: expected primary-expression before '>' token
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                                     ^
../src/common.cc:34:39: error: 'obj' was not declared in this scope
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                                       ^~~
../src/common.cc:34:56: error: expected primary-expression before 'attr'
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                                                        ^~~~
../src/common.cc:37:29: error: redefinition of 'std::string sharp::AttrAsStr'
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                             ^~~~~~
In file included from ../src/common.cc:27:0:
../src/common.h:79:15: note: 'std::string sharp::AttrAsStr' previously declared here
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
               ^~~~~~~~~
../src/common.cc:37:25: error: 'Handle' is not a member of 'v8'
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                         ^~
../src/common.cc:37:46: error: expected primary-expression before '>' token
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                                              ^
../src/common.cc:37:48: error: 'obj' was not declared in this scope
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                                                ^~~
../src/common.cc:37:65: error: expected primary-expression before 'attr'
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                                                                 ^~~~
../src/common.cc:40:38: error: redefinition of 'std::vector<double> sharp::AttrAsRgba'
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
                                      ^~~~~~
In file included from ../src/common.cc:27:0:
../src/common.h:80:23: note: 'std::vector<double> sharp::AttrAsRgba' previously declared here
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                       ^~~~~~~~~~
../src/common.cc:40:34: error: 'Handle' is not a member of 'v8'
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
                                  ^~
../src/common.cc:40:55: error: expected primary-expression before '>' token
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
                                                       ^
../src/common.cc:40:57: error: 'obj' was not declared in this scope
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
                                                         ^~~
../src/common.cc:40:74: error: expected primary-expression before 'attr'
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
                                                                          ^~~~
../src/common.cc:654:1: error: expected '}' at end of input
 }  // namespace sharp
 ^
cc1plus: warning: unrecognized command line option '-Wno-cast-function-type'
sharp.target.mk:134: recipe for target 'Release/obj.target/sharp/src/common.o' failed
make: *** [Release/obj.target/sharp/src/common.o] Error 1
make: Leaving directory '/builds/abhimanyuaryan/abhimanyuaryan.gitlab.io/node_modules/sharp/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Linux 4.19.23-coreos-r1
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /builds/abhimanyuaryan/abhimanyuaryan.gitlab.io/node_modules/sharp
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-05-07T21_27_54_072Z-debug.log
ERROR: Job failed: exit code 1
@jonniebigodes jonniebigodes added the status: awaiting author response Additional information has been requested from the author label May 8, 2019
@jonniebigodes
Copy link

@AbhimanyuAryan ok, skimming though the issue description, looks like something probably is not added in the gitlab configuration file, namely gitlab.yml.
I'm going to leave below the contents of a .gitlab.yml that works with gitlab.

#require latest node
image: node:latest

stages:
  - deploy

# add cache to node_modules for speed
cache:
  paths:
    - node_modules/ #node modules and dependencies
    #- .cache/

# the 'pages' job will deploy and build your site to the 'public' path
pages:
  stage: deploy
  script:
    - apt-get update -qy
    - apt-get install -y build-essential
    - npm install
    - npm run build # build the site
  artifacts:
    paths:
    - public
  only:
   - master

Key thing here, the installation of the development package suit build-essential, it will the necessary libraries that will make gatsby-image and it's underlying packages and dependencies work in that environmnent. Also i'm going to leave here the scripts portion of my example running in gitlab.

"scripts": {
    "build": "gatsby build --prefix-paths",
    "develop": "gatsby develop",
    "start": "npm run develop",
    "format": "prettier --write \"src/**/*.js\"",
    "test": "echo \"Error: no test specified\" && exit 1"
  },

Feel free to provide feedback so that we can close this issue, or continue to work on it till we do find a solution.

@AbhimanyuAryan
Copy link
Author

AbhimanyuAryan commented May 8, 2019

@jonniebigodes I got this error. After adding "scripts" to package.json and modifying .gitlab-ci.yml

Running with gitlab-runner 11.11.0-rc2 (7f58b1ec)
  on docker-auto-scale fa6cab46
Using Docker executor with image node:latest ...
Pulling docker image node:latest ...
Using docker image sha256:c77f0d290562eefd2c9e5481cc1707f40a43d2dd5f7719384bd3b8f05699ffd7 for node:latest ...
Running on runner-fa6cab46-project-11401935-concurrent-0 via runner-fa6cab46-srm-1557343506-175d7ed7...
Initialized empty Git repository in /builds/abhimanyuaryan/abhimanyuaryan.gitlab.io/.git/
Fetching changes...
Created fresh repository.
From https://gitlab.com/abhimanyuaryan/abhimanyuaryan.gitlab.io
 * [new branch]      master     -> origin/master
Checking out ae50d508 as master...

Skipping Git submodules setup
Checking cache for default-1...
FATAL: file does not exist                         
Failed to extract cache
$ apt-get update -qy
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Ign:2 http://deb.debian.org/debian stretch InRelease
Get:3 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2434 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [488 kB]
Get:7 http://deb.debian.org/debian stretch-updates/main amd64 Packages [31.7 kB]
Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7082 kB]
Fetched 7907 kB in 1s (4625 kB/s)
Reading package lists...
$ apt-get install -y build-essential
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  build-essential
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 7346 B of archives.
After this operation, 20.5 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 build-essential amd64 12.3 [7346 B]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 7346 B in 0s (259 kB/s)
Selecting previously unselected package build-essential.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 29980 files and directories currently installed.)
Preparing to unpack .../build-essential_12.3_amd64.deb ...
Unpacking build-essential (12.3) ...
Setting up build-essential (12.3) ...
$ npm install

> [email protected] install /builds/abhimanyuaryan/abhimanyuaryan.gitlab.io/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.1.0 runtime=node arch=x64 libc= platform=linux)
make: Entering directory '/builds/abhimanyuaryan/abhimanyuaryan.gitlab.io/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
In file included from /usr/include/c++/6/cassert:44:0,
                 from /root/.node-gyp/12.1.0/include/node/node_object_wrap.h:26,
                 from ../../nan/nan.h:55,
                 from ../src/common.cc:24:
../../nan/nan_object_wrap.h: In destructor 'virtual Nan::ObjectWrap::~ObjectWrap()':
../../nan/nan_object_wrap.h:24:25: error: 'class Nan::Persistent<v8::Object>' has no member named 'IsNearDeath'
     assert(persistent().IsNearDeath());
                         ^
../../nan/nan_object_wrap.h: In static member function 'static void Nan::ObjectWrap::WeakCallback(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)':
../../nan/nan_object_wrap.h:127:26: error: 'class Nan::Persistent<v8::Object>' has no member named 'IsNearDeath'
     assert(wrap->handle_.IsNearDeath());
                          ^
In file included from ../src/common.cc:27:0:
../src/common.h: At global scope:
../src/common.h:78:16: error: 'Handle' is not a member of 'v8'
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                ^~
../src/common.h:78:37: error: expected primary-expression before '>' token
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                     ^
../src/common.h:78:39: error: 'obj' was not declared in this scope
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                       ^~~
../src/common.h:78:56: error: expected primary-expression before 'attr'
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                                        ^~~~
../src/common.h:78:60: error: expression list treated as compound expression in initializer [-fpermissive]
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                                            ^
../src/common.h:79:25: error: 'Handle' is not a member of 'v8'
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                         ^~
../src/common.h:79:46: error: expected primary-expression before '>' token
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                                              ^
../src/common.h:79:48: error: 'obj' was not declared in this scope
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                                                ^~~
../src/common.h:79:65: error: expected primary-expression before 'attr'
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                                                                 ^~~~
../src/common.h:80:34: error: 'Handle' is not a member of 'v8'
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                                  ^~
../src/common.h:80:55: error: expected primary-expression before '>' token
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                                                       ^
../src/common.h:80:57: error: 'obj' was not declared in this scope
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                                                         ^~~
../src/common.h:80:74: error: expected primary-expression before 'attr'
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                                                                          ^~~~
../src/common.h:81:44: error: 'Handle' is not a member of 'v8'
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                            ^~
../src/common.h:81:65: error: expected primary-expression before '>' token
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                 ^
../src/common.h:81:67: error: 'obj' was not declared in this scope
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                   ^~~
../src/common.h:81:84: error: expected primary-expression before 'attr'
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                                    ^~~~
../src/common.h:81:37: warning: variable templates only available with -std=c++14 or -std=gnu++14
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                     ^~~~~~
../src/common.h:81:90: error: expected ';' before '{' token
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                                          ^
../src/common.h:84:33: error: 'Handle' is not a member of 'v8'
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                 ^~
../src/common.h:84:54: error: expected primary-expression before '>' token
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                                      ^
../src/common.h:84:56: error: 'obj' was not declared in this scope
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                                        ^~~
../src/common.h:84:73: error: expected primary-expression before 'attr'
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                                                         ^~~~
../src/common.h:84:26: warning: variable templates only available with -std=c++14 or -std=gnu++14
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                          ^~~~~~
../src/common.h:84:79: error: expected ';' before '{' token
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                                                               ^
../src/common.h:87:33: error: 'Handle' is not a member of 'v8'
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                 ^~
../src/common.h:87:54: error: expected primary-expression before '>' token
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                                      ^
../src/common.h:87:56: error: 'obj' was not declared in this scope
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                                        ^~~
../src/common.h:87:61: error: expected primary-expression before 'int'
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                                             ^~~
../src/common.h:84:26: warning: variable templates only available with -std=c++14 or -std=gnu++14
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                          ^~~~~~
../src/common.h:87:71: error: expected ';' before '{' token
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                                                       ^
../src/common.h:93:5: error: 'Handle' is not a member of 'v8'
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
     ^~
../src/common.h:93:26: error: expected primary-expression before '>' token
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                          ^
../src/common.h:93:28: error: 'input' was not declared in this scope
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                            ^~~~~
../src/common.h:93:70: error: expected primary-expression before '&' token
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                                                                      ^
../src/common.h:93:71: error: 'buffersToPersist' was not declared in this scope
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                                                                       ^~~~~~~~~~~~~~~~
../src/common.h:93:87: error: expression list treated as compound expression in initializer [-fpermissive]
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                                                                                       ^
../src/common.cc:34:20: error: redefinition of 'bool sharp::HasAttr'
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                    ^~~~~~
In file included from ../src/common.cc:27:0:
../src/common.h:78:8: note: 'bool sharp::HasAttr' previously defined here
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
        ^~~~~~~
../src/common.cc:34:16: error: 'Handle' is not a member of 'v8'
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                ^~
../src/common.cc:34:37: error: expected primary-expression before '>' token
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                                     ^
../src/common.cc:34:39: error: 'obj' was not declared in this scope
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                                       ^~~
../src/common.cc:34:56: error: expected primary-expression before 'attr'
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                                                        ^~~~
../src/common.cc:37:29: error: redefinition of 'std::string sharp::AttrAsStr'
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                             ^~~~~~
In file included from ../src/common.cc:27:0:
../src/common.h:79:15: note: 'std::string sharp::AttrAsStr' previously declared here
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
               ^~~~~~~~~
../src/common.cc:37:25: error: 'Handle' is not a member of 'v8'
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                         ^~
../src/common.cc:37:46: error: expected primary-expression before '>' token
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                                              ^
../src/common.cc:37:48: error: 'obj' was not declared in this scope
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                                                ^~~
../src/common.cc:37:65: error: expected primary-expression before 'attr'
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                                                                 ^~~~
../src/common.cc:40:38: error: redefinition of 'std::vector<double> sharp::AttrAsRgba'
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
                                      ^~~~~~
In file included from ../src/common.cc:27:0:
../src/common.h:80:23: note: 'std::vector<double> sharp::AttrAsRgba' previously declared here
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                       ^~~~~~~~~~
../src/common.cc:40:34: error: 'Handle' is not a member of 'v8'
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
                                  ^~
../src/common.cc:40:55: error: expected primary-expression before '>' token
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
                                                       ^
../src/common.cc:40:57: error: 'obj' was not declared in this scope
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
                                                         ^~~
../src/common.cc:40:74: error: expected primary-expression before 'attr'
   std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
                                                                          ^~~~
../src/common.cc:654:1: error: expected '}' at end of input
 }  // namespace sharp
 ^
cc1plus: warning: unrecognized command line option '-Wno-cast-function-type'
sharp.target.mk:134: recipe for target 'Release/obj.target/sharp/src/common.o' failed
make: *** [Release/obj.target/sharp/src/common.o] Error 1
make: Leaving directory '/builds/abhimanyuaryan/abhimanyuaryan.gitlab.io/node_modules/sharp/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Linux 4.19.23-coreos-r1
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /builds/abhimanyuaryan/abhimanyuaryan.gitlab.io/node_modules/sharp
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-05-08T19_27_39_259Z-debug.log
ERROR: Job failed: exit code 1

@jonniebigodes
Copy link

@AbhimanyuAryan i've just finished a couple of tests with the starter blog, the first one was done after bumping the packages used and commiting them to gitlab, checked the CI/CD and it ran without issues. After that i cleaned the cache and retried the deployment and apart of one error, that being that the cache was not present, once again it ran without any issues. I'll leave the repo used here so that you go over it and compare it to yours.

@sidharthachatterjee
Copy link
Contributor

@AbhimanyuAryan You're using [email protected] and node:latest (which is now resolving to Node v12)

[email protected] doesn't support Node v12

Please update gatsby-plugin-sharp and other packages that depend on sharp to their latest versions as documented in https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-manifest#incompatible-library-version-sharpnode-requires-version-x-or-later-but-z-provides-version-y

@AbhimanyuAryan
Copy link
Author

AbhimanyuAryan commented May 11, 2019

@sidharthachatterjee how can I mention older image of Node which works fine. All I want to do is change gitlab.yml file. I don't want to upgrade to the latest stuff. I have been facing problems with Gatsby for the past 6 months. Every time I deploy there's something outdated

just tell me...which version will work: https://hub.docker.com/_/node?tab=description

and i'll change to that docker image

@jonniebigodes
Copy link

@AbhimanyuAryan alternatively you can try:

image: node:10

to get a node 10 image. Or like the repo i posted the packages are bumped to the almost final versions or go with @sidharthachatterjee option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting author response Additional information has been requested from the author
Projects
None yet
Development

No branches or pull requests

3 participants