Giter Club home page Giter Club logo

Comments (7)

vkotovv avatar vkotovv commented on May 18, 2024 1

I've tried to use npm to install it for the first time, it gave me this error:

kotov@kotov-office:~/Apps/mermaid-cli$ npm install @mermaid-js/mermaid-cli

> [email protected] install /home/kotov/Apps/mermaid-cli/node_modules/puppeteer
> node install.js

(node:21308) UnhandledPromiseRejectionWarning: /home/kotov/Apps/mermaid-cli/node_modules/puppeteer/lib/cjs/puppeteer/install.js:134
                    catch {
                          ^

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at download (/home/kotov/Apps/mermaid-cli/node_modules/puppeteer/install.js:35:7)
(node:21308) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:21308) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
npm WARN saveError ENOENT: no such file or directory, open '/home/kotov/Apps/mermaid-cli/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/kotov/Apps/mermaid-cli/package.json'
npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN mermaid-cli No description
npm WARN mermaid-cli No repository field.
npm WARN mermaid-cli No README data
npm WARN mermaid-cli No license field.

+ @mermaid-js/[email protected]
added 63 packages from 77 contributors and audited 63 packages in 5.191s
found 0 vulnerabilities

After that I've deleted node_modules and installed it via yarn, and now I have the error in the description.
Is there anything wrong with my system now? Maybe I should uninstall something or delete some files to make it work?

from mermaid-cli.

MindaugasLaganeckas avatar MindaugasLaganeckas commented on May 18, 2024

@vkotovv : I just tried with the docker image, where we install the newly released mermaid cli and it worked fine:
docker run minlag/mermaid-cli:8.7.0 -h
I will try to reproduce the error by installing locally. ETA: sometime next week.

from mermaid-cli.

MindaugasLaganeckas avatar MindaugasLaganeckas commented on May 18, 2024

@vkotovv : I cannot reproduce the error:

root@f49fbe021825:/# yarn add @mermaid-js/mermaid-cli
yarn add v1.22.4
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 60 new dependencies.
info Direct dependencies
└─ @mermaid-js/[email protected]
info All dependencies
├─ @mermaid-js/[email protected]
├─ @types/[email protected]
├─ @types/[email protected]
├─ @types/[email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
Done in 11.92s.
root@f49fbe021825:/# ./node_modules/.bin/mmdc -h
Usage: mmdc [options]

Options:
  -V, --version                                   output the version number
  -t, --theme [theme]                             Theme of the chart, could be default, forest, dark or neutral. Optional. Default: default (default: "default")
  -w, --width [width]                             Width of the page. Optional. Default: 800 (default: "800")
  -H, --height [height]                           Height of the page. Optional. Default: 600 (default: "600")
  -i, --input <input>                             Input mermaid file. Required.
  -o, --output [output]                           Output file. It should be either svg, png or pdf. Optional. Default: input + ".svg"
  -b, --backgroundColor [backgroundColor]         Background color. Example: transparent, red, '#F0F0F0'. Optional. Default: white
  -c, --configFile [configFile]                   JSON configuration file for mermaid. Optional
  -C, --cssFile [cssFile]                         CSS file for the page. Optional
  -s, --scale [scale]                             Puppeteer scale factor, default 1. Optional
  -p --puppeteerConfigFile [puppeteerConfigFile]  JSON configuration file for puppeteer. Optional
  -h, --help                                      display help for command

from mermaid-cli.

MindaugasLaganeckas avatar MindaugasLaganeckas commented on May 18, 2024

@vkotovv : I would suggest to upgrade yarn if you are not using the newest. Another thing, you can try to use node docker image for your experiments. This way you can try to compare your system setup with the one in the docker image. I hope this helps!

from mermaid-cli.

vkotovv avatar vkotovv commented on May 18, 2024

Still the same error after upgrading yarn to 1.22.4.

from mermaid-cli.

bhyland avatar bhyland commented on May 18, 2024

I can confirm this error using npm 6.14.8 on Ubuntu 18.04

from mermaid-cli.

MindaugasLaganeckas avatar MindaugasLaganeckas commented on May 18, 2024

We have released many new versions of mermaid-cli since then. I will close this issue. Please, reopen if you disagree.

from mermaid-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.