i’m trying to push my app to heroku and whenever I try this it raises an error asking to add x86_64-linux to my platforms which is apparently normal with a bundler 2.2.3+. This is not a problem however when I do this it raises an error with precompling assets.
remote: /app/.node-gyp/16.13.1/include/node/v8-internal.h:492:38: error: ‘remove_cv_t’ is not a member of ‘std’; did you mean ‘remove_cv’? remote: 492 | !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data); remote: | ^~~~~~~~~~~ remote: | remove_cv remote: /app/.node-gyp/16.13.1/include/node/v8-internal.h:492:38: error: ‘remove_cv_t’ is not a member of ‘std’; did you mean ‘remove_cv’? remote: 492 | !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data); remote: | ^~~~~~~~~~~ remote: | remove_cv remote: /app/.node-gyp/16.13.1/include/node/v8-internal.h:492:50: error: template argument 2 is invalid remote: 492 | !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data); remote: | ^ remote: /app/.node-gyp/16.13.1/include/node/v8-internal.h:492:63: error: ‘::Perform’ has not been declared remote: 492 | !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data); remote: | ^~~~~~~
and
remote: /app/.node-gyp/16.13.1/include/node/node.h:855:3: note: in expansion of macro ‘NODE_MODULE_X’ remote: 855 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) remote: | ^~~~~~~~~~~~~ remote: ../src/binding.cpp:358:1: note: in expansion of macro ‘NODE_MODULE’ remote: 358 | NODE_MODULE(binding, RegisterModule); remote: | ^~~~~~~~~~~ remote: make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1 remote: make: Leaving directory '/tmp/build_cfb0d744/node_modules/node- sass/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_cfb0d744/node_modules/node-gyp/lib/build.js:262:23) remote: gyp ERR! stack at ChildProcess.emit (node:events:390:28) remote: gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) remote: gyp ERR! System Linux 4.4.0-1098-aws remote: gyp ERR! command "/tmp/build_cfb0d744/bin/node" "/tmp/build_cfb0d744/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "-- libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" remote: gyp ERR! cwd /tmp/build_cfb0d744/node_modules/node-sass remote: gyp ERR! node -v v16.13.1 remote: gyp ERR! node-gyp -v v3.8.0 remote: gyp ERR! not ok remote: Build failed with error code: 1
From what I can tell the issue raised is that my node version and my node-sass version are not compatible, however when i check my node version in the terminal its v14.15.5 and my node-sass is 4.14.1 which is compatible. However as you see in the error it says the node version is 16.13.1. I belive this is coming from the fact that when I push to heroku it says this
remote: -----> Installing node-v16.13.1-linux-x64 remote: -----> Installing yarn-v1.22.17 remote: -----> Detecting rake tasks remote: -----> Preparing app for Rails asset pipeline
So it appers is if installing linux-x64 is installing node-v16.13.1 which is not compatible with my node-sass. Does anybody know how I can solve this.
Thanks so much for your help, i’m really stuck.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Make sure to activate the heroku/nodejs
buildpack and add an engines
section to your package.json
(or update the one that’s already there):
{
"name": "...",
"description": "...",
"version": "...",
"engines": {
"node": "14.x"
}
}
Then commit and redeploy.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0