ReferenceError: window is not defined
See original GitHub issueIn Node REPL when I type const mermaid = require('mermaid');
it tell me
ReferenceError: window is not defined at new Log (/[my project]/node_modules/mermaid/src/logger.js:87:18) at Object.<anonymous> (/[my project]/node_modules/mermaid/src/mermaid.js:8:11) at Module._compile (module.js:571:32) at Object.Module._extensions…js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at repl:1:17
And 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
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
How to solve "window is not defined" errors in React and ...
How to solve "window is not defined" errors in React and Next.js · 1. First solution: typeof · 2. Second solution: the useEffect...
Read more >How to solve Next.js window is not defined
ReferenceError: window is not defined is a pretty common error you may run into when using Next.js for the first time but don't...
Read more >referenceerror: window is not defined, how to solve
Here's how to fix the “referenceerror: window is not defined” error that you might have in Node.js or with a tool like Next.js....
Read more >How To Solve ReferenceError window is not defined in ...
Fixing a window is not defined error can be quite simple. In most cases, all you will need to do is wrap your...
Read more >[Solved] ReferenceError : window is not defined - ItsJavaScript
The ReferenceError : window is not defined error mainly occurs if you are using the window object in Node.js, React.js, Next.js.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unsure if this is expected, but it looks like mermaid v8.0.0 cannot be used in Node.js (
window is not defined
error). Using mermaid v7.1.0 seems to work fine though.I wanted to use mermaid JS while transpiling markdown to html+js+css. During transpilation I do not have a browser environment available (normally).