Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't be installed globally #2

Open
Timmmm opened this issue Apr 7, 2022 · 2 comments
Open

Can't be installed globally #2

Timmmm opened this issue Apr 7, 2022 · 2 comments

Comments

@Timmmm
Copy link

Timmmm commented Apr 7, 2022

Unfortunately if you try this via npm install --global it doesn't work because this fails:

  const excalidrawUtils = fs.readFileSync(
    "./node_modules/@excalidraw/utils/dist/excalidraw-utils.min.js",
    "utf8"
  );

I'm not sure the best solution to that to be honest.

@JRJurman
Copy link
Owner

JRJurman commented Apr 9, 2022

Hmmmm, good catch... Yeah, this is because we're doing a relative reference for the dependency... I'll try to verify on my machine what the behavior is - can you confirm what OS you are using, version of npm, and if you are using a node manager (like nvm)?

@Timmmm
Copy link
Author

Timmmm commented Apr 10, 2022

Mac, can't remember the exact NPM version but a fairly recent one. Not using NVM.

Btw I made my own version after reading yours (thanks for doing the initial figuring out how to do it).

https://github.com/Timmmm/excalidraw_export

I think that one should work when globally installed - I just hackily bundled the Excalidraw JS into mine. I also added optional PDF export, some font workarounds and made the JSDom code way simpler.

Unfortunately you can't fully bundle it into a 0-dependency single JS file because JSDom's canvas is implemented using Cairo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants