-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
ReferenceError: window is not defined #485
Comments
You should not require('mermaid') in a node environment. It requires a web browser (or a headless browser like PhantomJS). Depending on your goal, you may or may not succeed by using its subcomponents as a library (see https://knsv.github.io/mermaid/#development11). |
Version 7.1.0 allows you to use mermaid in node directly.(but you still need a browser environment in order to render). |
Unsure if this is expected, but it looks like mermaid v8.0.0 cannot be used in Node.js ( |
@tylerlong Why did this lose support in the v8 release? |
@tylerlong Still cannot use in NodeJS :( |
:( |
I wanted to use mermaid JS while transpiling markdown to html+js+css. During transpilation I do not have a browser environment available (normally). |
Bumps [@sveltejs/kit](https://github.com/sveltejs/kit/tree/HEAD/packages/kit) from 1.0.0-next.192 to 1.0.0-next.194. - [Release notes](https://github.com/sveltejs/kit/releases) - [Changelog](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md) - [Commits](https://github.com/sveltejs/kit/commits/HEAD/packages/kit) --- updated-dependencies: - dependency-name: "@sveltejs/kit" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
In Node REPL when I type
const mermaid = require('mermaid');
it tell meAnd I try to install it with these ways:
npm install mermaid
npm install git+https://github.com/knsv/mermaid.git
but it still not work.
My Node version is
v7.7.1
,and npm version is
4.1.2
The text was updated successfully, but these errors were encountered: