Reputation: 1495
I have been working on this for some time without an issue. I made one small change, which had nothing to do with the dependencies or packages of the app - it was just in a controller method. When I go to push to heroku, I'm getting this error. I also tried changing branches, but the error persists.
I don't even know what Sharp is, but it seems to be causing the issue, or maybe it's a false alarm but it's showing the issue as sharp but it's something else?
(Before someone makes the suggestion - I replaced the name of my app with 'example'. No, it's not like that in the actual script.)
Total 0 (delta 0),
reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=false
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 12.x...
remote: Downloading and installing node 12.13.0...
remote: Using default npm version: 6.12.0
remote:
remote: -----> Restoring cache
remote: Caching has been disabled because NODE_MODULES_CACHE=false
remote:
remote: -----> Installing dependencies
remote: Installing node modules (package.json + package-lock)
remote:
remote: > [email protected] install /tmp/build_739dd517149d4391a47cfc8a1f1dd282/node_modules/node-paperclip-resize-image/node_modules/sharp
remote: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
remote:
remote: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-linux-x64.tar.gz
remote: make: Entering directory '/tmp/build_739dd517149d4391a47cfc8a1f1dd282/node_modules/node-paperclip-resize-image/node_modules/sharp/build'
remote: TOUCH Release/obj.target/libvips-cpp.stamp
remote: CXX(target) Release/obj.target/sharp/src/common.o
remote: In file included from ../src/common.cc:27:0:
remote: ../src/common.h:78:20: error: ‘Handle’ is not a member of ‘v8’
remote: bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
remote: ^~~~~~
remote: ../src/common.h:78:37: error: expected primary-expression before ‘>’ token
remote: bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
remote: ^
remote: ../src/common.h:78:39: error: ‘obj’ was not declared in this scope
remote: bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
remote: ^~~
remote: ../src/common.h:78:56: error: expected primary-expression before ‘attr’
remote: bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
remote: ^~~~
remote: ../src/common.h:78:60: error: expression list treated as compound expression in initializer [-fpermissive]
remote: bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
remote: ^
remote: ../src/common.h:79:29: error: ‘Handle’ is not a member of ‘v8’
remote: std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
remote: ^~~~~~
remote: ../src/common.h:79:46: error: expected primary-expression before ‘>’ token
remote: std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
remote: ^
remote: ../src/common.h:79:48: error: ‘obj’ was not declared in this scope
remote: std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
remote: ^~~
remote: ../src/common.h:79:65: error: expected primary-expression before ‘attr’
remote: std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
remote: ^~~~
remote: ../src/common.h:80:38: error: ‘Handle’ is not a member of ‘v8’
remote: std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
remote: ^~~~~~
remote: ../src/common.h:80:55: error: expected primary-expression before ‘>’ token
remote: std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
remote: ^
remote: ../src/common.h:80:57: error: ‘obj’ was not declared in this scope
remote: std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
remote: ^~~
remote: ../src/common.h:80:74: error: expected primary-expression before ‘attr’
remote: std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
remote: ^~~~
remote: ../src/common.h:81:48: error: ‘Handle’ is not a member of ‘v8’
remote: template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~~~
remote: ../src/common.h:81:65: error: expected primary-expression before ‘>’ token
remote: template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^
remote: ../src/common.h:81:67: error: ‘obj’ was not declared in this scope
remote: template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~
remote: ../src/common.h:81:84: error: expected primary-expression before ‘attr’
remote: template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~
remote: ../src/common.h:81:37: warning: variable templates only available with -std=c++14 or -std=gnu++14
remote: template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~~~
remote: ../src/common.h:81:90: error: expected ‘;’ before ‘{’ token
remote: template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^
remote: ../src/common.h:84:37: error: ‘Handle’ is not a member of ‘v8’
remote: template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~~~
remote: ../src/common.h:84:54: error: expected primary-expression before ‘>’ token
remote: template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^
remote: ../src/common.h:84:56: error: ‘obj’ was not declared in this scope
remote: template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~
remote: ../src/common.h:84:73: error: expected primary-expression before ‘attr’
remote: template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~
remote: ../src/common.h:84:26: warning: variable templates only available with -std=c++14 or -std=gnu++14
remote: template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~~~
remote: ../src/common.h:84:79: error: expected ‘;’ before ‘{’ token
remote: template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^
remote: ../src/common.h:87:37: error: ‘Handle’ is not a member of ‘v8’
remote: template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
remote: ^~~~~~
remote: ../src/common.h:87:54: error: expected primary-expression before ‘>’ token
remote: template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
remote: ^
remote: ../src/common.h:87:56: error: ‘obj’ was not declared in this scope
remote: template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
remote: ^~~
remote: ../src/common.h:87:61: error: expected primary-expression before ‘int’
remote: template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
remote: ^~~
remote: ../src/common.h:84:26: warning: variable templates only available with -std=c++14 or -std=gnu++14
remote: template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~~~
remote: ../src/common.h:87:71: error: expected ‘;’ before ‘{’ token
remote: template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
remote: ^
remote: ../src/common.h:93:9: error: ‘Handle’ is not a member of ‘v8’
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
remote: ^~~~~~
remote: ../src/common.h:93:26: error: expected primary-expression before ‘>’ token
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
remote: ^
remote: ../src/common.h:93:28: error: ‘input’ was not declared in this scope
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
remote: ^~~~~
remote: ../src/common.h:93:28: note: suggested alternative: ‘ino_t’
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
remote: ^~~~~
remote: ino_t
remote: ../src/common.h:93:70: error: expected primary-expression before ‘&’ token
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
remote: ^
remote: ../src/common.h:93:71: error: ‘buffersToPersist’ was not declared in this scope
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
remote: ^~~~~~~~~~~~~~~~
remote: ../src/common.h:93:87: error: expression list treated as compound expression in initializer [-fpermissive]
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
remote: ^
remote: ../src/common.cc:34:20: error: redefinition of ‘bool sharp::HasAttr’
remote: bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~~~
remote: In file included from ../src/common.cc:27:0:
remote: ../src/common.h:78:8: note: ‘bool sharp::HasAttr’ previously defined here
remote: bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
remote: ^~~~~~~
remote: ../src/common.cc:34:20: error: ‘Handle’ is not a member of ‘v8’
remote: bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~~~
remote: ../src/common.cc:34:37: error: expected primary-expression before ‘>’ token
remote: bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^
remote: ../src/common.cc:34:39: error: ‘obj’ was not declared in this scope
remote: bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~
remote: ../src/common.cc:34:56: error: expected primary-expression before ‘attr’
remote: bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~
remote: ../src/common.cc:37:29: error: redefinition of ‘std::string sharp::AttrAsStr’
remote: std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~~~
remote: In file included from ../src/common.cc:27:0:
remote: ../src/common.h:79:15: note: ‘std::string sharp::AttrAsStr’ previously declared here
remote: std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
remote: ^~~~~~~~~
remote: ../src/common.cc:37:29: error: ‘Handle’ is not a member of ‘v8’
remote: std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~~~
remote: ../src/common.cc:37:46: error: expected primary-expression before ‘>’ token
remote: std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^
remote: ../src/common.cc:37:48: error: ‘obj’ was not declared in this scope
remote: std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~
remote: ../src/common.cc:37:65: error: expected primary-expression before ‘attr’
remote: std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~
remote: ../src/common.cc:40:38: error: redefinition of ‘std::vector<double> sharp::AttrAsRgba’
remote: std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~~~
remote: In file included from ../src/common.cc:27:0:
remote: ../src/common.h:80:23: note: ‘std::vector<double> sharp::AttrAsRgba’ previously declared here
remote: std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
remote: ^~~~~~~~~~
remote: ../src/common.cc:40:38: error: ‘Handle’ is not a member of ‘v8’
remote: std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~~~
remote: ../src/common.cc:40:55: error: expected primary-expression before ‘>’ token
remote: std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^
remote: ../src/common.cc:40:57: error: ‘obj’ was not declared in this scope
remote: std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~
remote: ../src/common.cc:40:74: error: expected primary-expression before ‘attr’
remote: std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
remote: ^~~~
remote: ../src/common.cc:51:9: error: redefinition of ‘sharp::InputDescriptor* sharp::CreateInputDescriptor’
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
remote: ^~~~~~
remote: In file included from ../src/common.cc:27:0:
remote: ../src/common.h:92:20: note: ‘sharp::InputDescriptor* sharp::CreateInputDescriptor’ previously defined here
remote: InputDescriptor* CreateInputDescriptor(
remote: ^~~~~~~~~~~~~~~~~~~~~
remote: ../src/common.cc:51:9: error: ‘Handle’ is not a member of ‘v8’
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
remote: ^~~~~~
remote: ../src/common.cc:51:26: error: expected primary-expression before ‘>’ token
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
remote: ^
remote: ../src/common.cc:51:28: error: ‘input’ was not declared in this scope
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
remote: ^~~~~
remote: ../src/common.cc:51:28: note: suggested alternative: ‘ino_t’
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
remote: ^~~~~
remote: ino_t
remote: ../src/common.cc:51:70: error: expected primary-expression before ‘&’ token
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
remote: ^
remote: ../src/common.cc:51:71: error: ‘buffersToPersist’ was not declared in this scope
remote: v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
remote: ^~~~~~~~~~~~~~~~
remote: cc1plus: warning: unrecognized command line option ‘-Wno-cast-function-type’
remote: sharp.target.mk:136: recipe for target 'Release/obj.target/sharp/src/common.o' failed
remote: make: *** [Release/obj.target/sharp/src/common.o] Error 1
remote: make: Leaving directory '/tmp/build_739dd517149d4391a47cfc8a1f1dd282/node_modules/node-paperclip-resize-image/node_modules/sharp/build'
remote: gyp ERR! build error
remote: gyp ERR! stack Error: `make` failed with exit code: 2
remote: gyp ERR! stack at ChildProcess.onExit (/tmp/build_739dd517149d4391a47cfc8a1f1dd282/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
remote: gyp ERR! stack at ChildProcess.emit (events.js:210:5)
remote: gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
remote: gyp ERR! System Linux 4.4.0-1048-aws
remote: gyp ERR! command "/tmp/build_739dd517149d4391a47cfc8a1f1dd282/.heroku/node/bin/node" "/tmp/build_739dd517149d4391a47cfc8a1f1dd282/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
remote: gyp ERR! cwd /tmp/build_739dd517149d4391a47cfc8a1f1dd282/node_modules/node-paperclip-resize-image/node_modules/sharp
remote: gyp ERR! node -v v12.13.0
remote: gyp ERR! node-gyp -v v5.0.5
remote: gyp ERR! not ok
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the [email protected] install script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.dLvYO/_logs/2019-10-28T14_55_48_980Z-debug.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: Some possible problems:
remote:
remote: - Node version not specified in package.json
remote: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to example.
remote:
To https://git.heroku.com/example.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/example.git'
Upvotes: 0
Views: 316
Reputation: 1495
I was correct - the issue was actually a discrepancy with Sharp and the version of Node I was using (12.xx.xx). I downgraded to 10.16.0 and it worked fine. I hope this saves someone else time :/
Upvotes: 2