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

NodeJS installation instructions #102

Open
maxwowpow opened this issue Apr 25, 2023 · 2 comments
Open

NodeJS installation instructions #102

maxwowpow opened this issue Apr 25, 2023 · 2 comments

Comments

@maxwowpow
Copy link

  • no release/dist folder on version 3 when installing from github via npm install @svgdotjs/svg.js so module cannot be imported:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'XXX\node_modules\@svgdotjs\svg.js\' imported from app.js
    at new NodeError (node:internal/errors:399:5)
    at legacyMainResolve (node:internal/modules/esm/resolve:202:9)
  • the command pulls repo instead of a package.

  • currently only release section and cdns have a compiled version.

  • current package.json refers /dist folder for release/compiled version.

  • The real question is why svg.js 3 is not published. If the repo supposed to be a src only repo, maybe a second repo for svg.js 3 makes sense?

@maxwowpow maxwowpow changed the title Installation instructions for npm install @svgdotjs/svg.js NodeJS installation instructions Apr 25, 2023
@ammoradi
Copy link

Any news on this?

@Fuzzyma
Copy link
Member

Fuzzyma commented Jun 18, 2024

Why are you pulling from github? Install via npm and the dist folder is right there.
You obvisouly need svgdom for this to run:

import { SVG, registerWindow } from "@svgdotjs/svg.js";
import { createSVGWindow } from "svgdom";

const window = createSVGWindow();
registerWindow(window, window.document);

const svg = SVG().addTo(window.document.documentElement);

svg.rect(100, 100);

console.log(svg.svg());

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

3 participants