0

When pushing my node.js project to heroku server. I receive the following error:

ERR! sharp 'darwin-x64' binaries cannot be used on the 'linux-x64' platform. Please remove the 'node_modules/sharp/vendor' directory and run 'npm install'. remote: info sharp Attempting to build from source via node-gyp but this may fail due to the above error remote: info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies

I reinstall node_modules as suggested however nothing changes. I am able to run my project locally. The error only arises when I am trying to push to heroku master. Can someone please help or explain.

  • Don't track your `node_modules/` at all. Ignore and untrack that whole folder. – Chris May 27 '20 at 18:08
  • Does this answer your question? [Should I check in node\_modules to git when creating a node.js app on Heroku?](https://stackoverflow.com/questions/11459475/should-i-check-in-node-modules-to-git-when-creating-a-node-js-app-on-heroku) – Chris May 27 '20 at 18:09
  • When you say "I reinstall node_modules" I assume you mean you reinstall it locally otherwise you wouldn't use the word "reinstall" and use "install" instead. Don't do that. The error message is telling you to install the node_modules on Heroku instead of locally – slebetman May 27 '20 at 18:18
  • No Chris, this does not answer my question. I already have a .gitignore file that is ignoring node_modules but it still doesn't work – Pablo Endara-Santiago May 27 '20 at 18:48
  • how would i install node_modules on heroku? – Pablo Endara-Santiago May 27 '20 at 18:49
  • I also tried to use shrinkwrap and is still coming up with the same error – Pablo Endara-Santiago May 27 '20 at 18:59

0 Answers0