cms icon indicating copy to clipboard operation
cms copied to clipboard

bug: yarn install failing on a mac

Open hkirat opened this issue 1 year ago • 5 comments

post https://github.com/code100x/cms/pull/487/files Something with the canvas library

hkirat avatar May 07 '24 07:05 hkirat

/Users/harkiratsingh/Projects/cms/node_modules/canvas: Command failed. Exit code: 1 Command: node-pre-gyp install --fallback-to-build --update-binary Arguments: Directory: /Users/harkiratsingh/Projects/cms/node_modules/canvas Output: node-pre-gyp info it worked if it ends with ok node-pre-gyp info using [email protected]

hkirat avatar May 07 '24 07:05 hkirat

cc @dhruvilmehta

hkirat avatar May 07 '24 07:05 hkirat

For Apple silicon chips, you need to run brew install pkg-config cairo pango libpng jpeg giflib librsvg. I tried this and it started running. Source:

  1. https://github.com/Automattic/node-canvas/wiki/Installation%3A-Mac-OS-X
  2. https://github.com/Automattic/node-canvas/issues/1825

dhruvilmehta avatar May 07 '24 08:05 dhruvilmehta

Failing on Linux as well !

VK-RED avatar May 09 '24 01:05 VK-RED

Is it still failing after running the above command? It solved the issue for me on Mac.

dhruvilmehta avatar May 09 '24 18:05 dhruvilmehta

No it did not solve for linux

VK-RED avatar May 11 '24 03:05 VK-RED

Canvas library is dependent on other packages that are not natively available on Linux machines and node-alpine images. So you need to install the dependencies in the machine before running npm install. Refer to this link: link . I have fixed the same in the Dockerfile and raised a PR #564 .

Arup20MA20010 avatar May 11 '24 11:05 Arup20MA20010