title: Error while installing canvas on Raspberry PI 4
body: <p>I've tried installing node canvas multiple times on my Raspberry PI 4, and every time, no matter what permissions I give, no matter how many times I install node-pre-gyp, it will always result in this same error.</p>
  <pre class="lang-js prettyprint-override"><code>
  &gt; canvas@2.6.1 install /home/pi/.djsbots/Starr/node_modules/canvas
  &gt; node-pre-gyp install --fallback-to-build
  
  node-pre-gyp WARN Using request for node-pre-gyp https download
  node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v72-linux-glibc-arm.tar.gz
  node-pre-gyp WARN Pre-built binaries not found for canvas@2.6.1 and node@12.16.3 (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
  gyp WARN EACCES current user (&quot;pi&quot;) does not have permission to access the dev dir &quot;/root/.cache/node-gyp/12.16.3&quot;
  gyp WARN EACCES attempting to reinstall using temporary dev dir &quot;/home/pi/.djsbots/Starr/node_modules/canvas/.node-gyp&quot;
  Package pixman-1 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `pixman-1.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'pixman-1' found
  gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
  gyp ERR! configure error
  gyp ERR! stack Error: `gyp` failed with exit code: 1
  gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
  gyp ERR! stack     at ChildProcess.emit (events.js:310:20)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
  gyp ERR! System Linux 4.19.97-v7l+
  gyp ERR! command &quot;/usr/local/bin/node&quot; &quot;/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js&quot; &quot;configure&quot; &quot;--fallback-to-build&quot; &quot;--module=/home/pi/.djsbots/Starr/node_modules/canvas/build/Release/canvas.node&quot; &quot;--module_name=canvas&quot; &quot;--module_path=/home/pi/.djsbots/Starr/node_modules/canvas/build/Release&quot; &quot;--napi_version=5&quot; &quot;--node_abi_napi=napi&quot; &quot;--napi_build_version=0&quot; &quot;--node_napi_label=node-v72&quot;
  gyp ERR! cwd /home/pi/.djsbots/Starr/node_modules/canvas
  gyp ERR! node -v v12.16.3
  gyp ERR! node-gyp -v v5.1.0
  gyp ERR! not ok
  node-pre-gyp ERR! build error
  node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/.djsbots/Starr/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/pi/.djsbots/Starr/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
  node-pre-gyp ERR! stack     at ChildProcess.&lt;anonymous&gt; (/home/pi/.djsbots/Starr/node_modules/canvas/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
  node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:310:20)
  node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
  node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
  node-pre-gyp ERR! System Linux 4.19.97-v7l+
  node-pre-gyp ERR! command &quot;/usr/local/bin/node&quot; &quot;/home/pi/.djsbots/Starr/node_modules/canvas/node_modules/.bin/node-pre-gyp&quot; &quot;install&quot; &quot;--fallback-to-build&quot;
  node-pre-gyp ERR! cwd /home/pi/.djsbots/Starr/node_modules/canvas
  node-pre-gyp ERR! node -v v12.16.3
  node-pre-gyp ERR! node-pre-gyp -v v0.11.0
  node-pre-gyp ERR! not ok
  Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/.djsbots/Starr/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/pi/.djsbots/Starr/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
  npm WARN starr@1.5.2 No description
  npm WARN starr@1.5.2 No repository field.
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;linux&quot;,&quot;arch&quot;:&quot;arm&quot;})
  
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
  npm ERR! Exit status 1
  npm ERR!
  npm ERR! Failed at the canvas@2.6.1 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/2020-06-21T00_57_47_594Z-debug.log
  
  </code></pre>
  <p>Any help would be appreciated</p>