Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

Fresh mermaid install crashes #15

Closed
dohamann opened this issue Nov 5, 2017 · 9 comments
Closed

Fresh mermaid install crashes #15

dohamann opened this issue Nov 5, 2017 · 9 comments

Comments

@dohamann
Copy link

dohamann commented Nov 5, 2017

I had to completely reinstall my ubuntu partition and as a result tried to install mermaid cli again, using these lines:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
apt-get install -y build-essential nodejs
npm install -g mermaid.cli
mmdc -i test.mermaid -o test.png

Resulting in

(node:19211) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: spawn EACCES
(node:19211) [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.

Node version is 8.9.0, NPM is 5.5.1

Any idea what the problem might be?
Thanks in advance!

@dohamann
Copy link
Author

dohamann commented Nov 5, 2017

NPM Output

$ sudo npm install mermaid.cli -g
/usr/bin/mmdc -> /usr/lib/node_modules/mermaid.cli/index.bundle.js

> puppeteer@0.12.0 install /usr/lib/node_modules/mermaid.cli/node_modules/puppeteer
> node install.js

Downloading Chromium r508693 - 96.2 Mb [====================] 100% 0.0s 
Chromium downloaded to /usr/lib/node_modules/mermaid.cli/node_modules/puppeteer/.local-chromium/linux-508693
/usr/lib
└─┬ mermaid.cli@0.3.1 
  ├─┬ chalk@2.3.0 
  │ ├─┬ ansi-styles@3.2.0 
  │ │ └─┬ color-convert@1.9.0 
  │ │   └── color-name@1.1.3 
  │ ├── escape-string-regexp@1.0.5 
  │ └─┬ supports-color@4.5.0 
  │   └── has-flag@2.0.0 
  ├── commander@2.11.0 
  └─┬ puppeteer@0.12.0 
    ├─┬ debug@2.6.9 
    │ └── ms@2.0.0 
    ├─┬ extract-zip@1.6.6 
    │ ├─┬ concat-stream@1.6.0 
    │ │ ├── inherits@2.0.3 
    │ │ ├─┬ readable-stream@2.3.3 
    │ │ │ ├── core-util-is@1.0.2 
    │ │ │ ├── isarray@1.0.0 
    │ │ │ ├── process-nextick-args@1.0.7 
    │ │ │ ├── string_decoder@1.0.3 
    │ │ │ └── util-deprecate@1.0.2 
    │ │ └── typedarray@0.0.6 
    │ ├─┬ mkdirp@0.5.0 
    │ │ └── minimist@0.0.8 
    │ └─┬ yauzl@2.4.1 
    │   └─┬ fd-slicer@1.0.1 
    │     └── pend@1.2.0 
    ├─┬ https-proxy-agent@2.1.0 
    │ └─┬ agent-base@4.1.1 
    │   └─┬ es6-promisify@5.0.0 
    │     └── es6-promise@4.1.1 
    ├── mime@1.4.1 
    ├── progress@2.0.0 
    ├── proxy-from-env@1.0.0 
    ├─┬ rimraf@2.6.2 
    │ └─┬ glob@7.1.2 
    │   ├── fs.realpath@1.0.0 
    │   ├─┬ inflight@1.0.6 
    │   │ └── wrappy@1.0.2 
    │   ├─┬ minimatch@3.0.4 
    │   │ └─┬ brace-expansion@1.1.8 
    │   │   ├── balanced-match@1.0.0 
    │   │   └── concat-map@0.0.1 
    │   ├── once@1.4.0 
    │   └── path-is-absolute@1.0.1 
    └─┬ ws@3.3.0 
      ├── async-limiter@1.0.0 
      ├── safe-buffer@5.1.1 
      └── ultron@1.1.0 

@agusmba
Copy link
Contributor

agusmba commented Nov 6, 2017

Maybe related to #16

@kellerj
Copy link

kellerj commented Nov 6, 2017

I worked around it by copying the mermaid CSS file per the upgrade command in package.json. You have to do that and run the prepublishOnly command. Then I was able to run the dev version as node index.bundle.js

@dohamann
Copy link
Author

Any updates on this or any related issue?

@tylerlong
Copy link
Contributor

tylerlong commented Feb 5, 2018

Tested on Ubuntu 16.04.3 LTS:

yarn global add mermaid.cli
yarn global bin  # which outputs ~/.yarn/bin
cd ~/.yarn/bin
./mmdc -h
./mmdc -i flowchart.mmd -o flowchart.png

Yarn doesn't install the bin to global path which I believe is yarn's bug: yarnpkg/yarn#648

@tylerlong
Copy link
Contributor

tylerlong commented Feb 5, 2018

Or you can install it locally:

yarn add mermaid.cli
./node_modules/.bin/mmdc -h
./node_modules/.bin/mmdc -i flowchart.mmd -o flowchart.png

Or use NPM:

npm install mermaid.cli
./node_modules/.bin/mmdc -h
./node_modules/.bin/mmdc -i flowchart.mmd -o flowchart.png

@dohamann
Copy link
Author

dohamann commented Mar 3, 2018

I can confirm that it worked for me by installing it locally via yarn

@Joe8Bit
Copy link

Joe8Bit commented Mar 1, 2021

Can confirm global installation works as expected on macOS Big Sur and Ubuntu 18.04 via npm install -g @mermaid-js/mermaid-cli.

Might be worth removing the warning from the README.md?

@KhalfaniW
Copy link

$ sudo npm install mermaid.cli -g

Do not install npm packages as root. See this article: https://medium.com/@ExplosionPills/dont-use-sudo-with-npm-still-66e609f5f92

npm install -g @mermaid-js/mermaid-cli also worked for me in Ubuntu 18.04 LTS.

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

No branches or pull requests

6 participants