title: How to fix BINARY ERROR when deploying a Node Js API REST to CPANEL. (shared hosting)
body: <p>first of all thanks for the help.</p>
  <p>I have a Node js API REST, i use Express, fs module, sharp for images and many others, everything works fine in my machine, and i wanted to test this API in a shared hosting that i purchased months ago.</p>
  <p>i have my app in my folder, the node js create app from CPANEL Recognizes my JSON file, when i click NPM INSTALL this is the error that comes up:</p>
  <pre><code>npm WARN lifecycle The node binary used for scripts is /home/webfoqgo/nodevenv/server/12/bin/node but npm is using /opt/alt/alt-nodejs12/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
  ERR! sharp Use with glibc 2.12 requires manual installation of libvips &gt;= 8.10.0
  info sharp Attempting to build from source via node-gyp but this may fail due to the above error
  info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
  make: execvp: cc: Permission denied
  make: *** [Release/obj.target/nothing/../node-addon-api/nothing.o] Error 127
  gyp ERR! build error 
  gyp ERR! stack Error: `make` failed with exit code: 2
  gyp ERR! stack     at ChildProcess.onExit (/opt/alt/alt-nodejs12/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/lib/build.js:194:23)
  gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
  gyp ERR! System Linux 2.6.32-954.3.5.lve1.4.77.el6.x86_64
  gyp ERR! command &quot;/opt/alt/alt-nodejs12/root/usr/bin/node&quot; &quot;/opt/alt/alt-nodejs12/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/bin/node-gyp.js&quot; &quot;rebuild&quot;
  gyp ERR! cwd /home/webfoqgo/nodevenv/server/12/lib/node_modules/sharp
  gyp ERR! node -v v12.19.1
  gyp ERR! node-gyp -v v5.1.0
  gyp ERR! not ok 
  npm WARN building-backend@1.0.0 No repository field.
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.1 (node_modules/fsevents):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;linux&quot;,&quot;arch&quot;:&quot;x64&quot;})
  
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! sharp@0.26.3 install: `(node install/libvips &amp;&amp; node install/dll-copy &amp;&amp; prebuild-install) || (node-gyp rebuild &amp;&amp; node install/dll-copy)`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the sharp@0.26.3 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!     /home/webfoqgo/.npm/_logs/2021-01-27T20_32_15_794Z-debug.log
  </code></pre>
  <p>i tried 2 things:</p>
  <p>1.- i made a .npmrc file in my project root like this:</p>
  <p><a href="https://i.stack.imgur.com/FmW7J.png" rel="noreferrer"><img src="https://i.stack.imgur.com/FmW7J.png" alt="Please let me know if i am doing this incorrectly" /></a></p>
  <p>2.- i deleted the SHARP dependency from my package.json -- this makes the process of NPM INSTALL in cpanel go well, no error, but do need sharp in my project so deleting it is not a viable option for production.</p>
  <p>Links that i have checked:
  <a href="https://stackoverflow.com/questions/51293566/how-to-include-the-path-for-the-node-binary-npm-was-executed-with">StackOverflow question. </a></p>
  <p>have anybody came across this sometime?
  Thank you very much.</p>