Closed angrykoala closed 6 years ago
It seems one of the changes in the last commit https://github.com/mermaidjs/mermaid.cli/commit/1f9a6bce11289f4227d3fb0a93a512690953540d is breaking also the dev version.
I'll try to narrow it down
In my case it's puppetteer's new version (with new chrome) giving me grief.
In windows, the problem seems to be with my antivirus, for some reason it won't let me execute chrome when I use puppeteer 0.12.0 instead of 0.11.0.
I tried with a dockerized node 8.9 and again run into problems, with both mermaid.cli 0.2.1 and 0.3.1
It could be tracked down to https://github.com/GoogleChrome/puppeteer/issues/290#issuecomment-322838700
I tried the workaround there of using {args: ['--no-sandbox', '--disable-setuid-sandbox']}
and it worked, but this is not an acceptable solution security-wise.
Maybe @tylerlong can take a look... @angrykoala could you also check https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
just in case there are some dependencies missing at the OS level?
@agusmba All dependencies are installed in my system, and it is werid that it is a dependency when the problem is explicitly about an unhandled promise
The problem appears to be puppeteer failing to properly launch chrome. There seem to be many different reasons for failing to launch chrome, like an antivirus (my case), missing deps, or lack of kernel support.
Does mermaid.cli version 0.2.1 work for you?
Trying to install/uninstall (as sudo) mermaid.cli globally fails with the following error:
fs.js:885
return binding.mkdir(pathModule._makeLong(path),
^
Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/.local-chromium'
I'm not sure if this error is related or may help to this issue
For what it's worth, version 0.3.1 is working fine on my windows 7 box (no antivirus issues either), node v6.11.0
@angrykoala it sure looks like there's a problem with your puppeteer / chromium
0.3.1 also working on my windows 10 (convinced the antivirus that chrome.exe is safe).
Can confirm this happens in Ubuntu 17.10.
Manually fettling package.json
to include v0.13.0
of puppeteer within the mermaid.cli
package seems to have got the mmdc
working for me.
Ok ... As part of my testing I reverted the version of puppeteer back to 0.12 to make sure it still did not work ... but it did work. This is confusing as now everything is working fine and I cannot get things to break again. Leaving this here in case it helps!
I cannot reproduce the issue you reported.
If you are having issues, please try the following:
./node_modules/.bin/mmdc
. Sometime YARN or NPM just failed to install this library globally properly due to some weird permission issues. Installing it locally will fix the issue.@tylerlong I have the same issue (can't reopen the issue). Here is what I did:
sudo npm install mermaid.cli
locate mmdc
/home/jonas/Documents/node_modules/.bin/mmdc
/usr/lib/node_modules/mermaid-filter/node_modules/.bin/mmdc
graph LR
A-->B;
/home/jonas/Documents/node_modules/.bin/mmdc -i my_file.mmd
gives me the error:(node:11047) UnhandledPromiseRejectionWarning: Error: spawn EACCES at ChildProcess.spawn (internal/child_process.js:330:11) at Object.exports.spawn (child_process.js:500:9) at Function.launch (/home/jonas/Documents/node_modules/puppeteer/lib/Launcher.js:106:40) at
(node:11047) 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:11047) [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.
My setup:
OS: Manjaro (Linux): Linux 4.4.126-1-MANJARO #1 SMP PREEMPT Sat Mar 31 17:16:02 UTC 2018
nodeJS: 9.9.0-2
mmdc: 0.4.5
Let me know if you need more information.
@Salzi
If you install it locally (in your current folder), you don't need to locate
it at all.
Just ./node_modules/.bin/mmdc -i ...
The binary you located might not be the one you just installed.
And from the error message, it is a permission issue. You can try sudo
.
Tested on ubuntu Linux:
tyler@tyler-VirtualBox:~/src$ cd temp
tyler@tyler-VirtualBox:~/src/temp$ ls
flowchart.mmd
tyler@tyler-VirtualBox:~/src/temp$ yarn add mermaid.cli
yarn add v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
warning Your current version of Yarn is out of date. The latest version is "1.5.1" while you're on "1.3.2".
info To upgrade, run the following command:
$ sudo apt-get update && sudo apt-get install yarn
success Saved 49 new dependencies.
├─ agent-base@4.2.0
├─ ansi-styles@3.2.1
├─ async-limiter@1.0.0
├─ balanced-match@1.0.0
├─ brace-expansion@1.1.11
├─ chalk@2.3.2
├─ color-convert@1.9.1
├─ color-name@1.1.3
├─ commander@2.15.1
├─ concat-map@0.0.1
├─ concat-stream@1.6.0
├─ core-util-is@1.0.2
├─ debug@2.6.9
├─ es6-promise@4.2.4
├─ es6-promisify@5.0.0
├─ escape-string-regexp@1.0.5
├─ extract-zip@1.6.6
├─ fd-slicer@1.0.1
├─ fs.realpath@1.0.0
├─ glob@7.1.2
├─ has-flag@3.0.0
├─ https-proxy-agent@2.2.1
├─ inflight@1.0.6
├─ inherits@2.0.3
├─ isarray@1.0.0
├─ mermaid.cli@0.4.6
├─ mime@1.6.0
├─ minimatch@3.0.4
├─ minimist@0.0.8
├─ mkdirp@0.5.0
├─ ms@2.0.0
├─ once@1.4.0
├─ path-is-absolute@1.0.1
├─ pend@1.2.0
├─ process-nextick-args@2.0.0
├─ progress@2.0.0
├─ proxy-from-env@1.0.0
├─ puppeteer@1.3.0
├─ readable-stream@2.3.6
├─ rimraf@2.6.2
├─ safe-buffer@5.1.1
├─ string_decoder@1.1.1
├─ supports-color@5.3.0
├─ typedarray@0.0.6
├─ ultron@1.1.1
├─ util-deprecate@1.0.2
├─ wrappy@1.0.2
├─ ws@3.3.3
└─ yauzl@2.4.1
Done in 43.44s.
tyler@tyler-VirtualBox:~/src/temp$ ./node_modules/.bin/mmdc -i flowchart.mmd
tyler@tyler-VirtualBox:~/src/temp$ ls
flowchart.mmd flowchart.mmd.svg node_modules package.json yarn.lock
tyler@tyler-VirtualBox:~/src/temp$ ./node_modules/.bin/mmdc -i flowchart.mmd -o flowchart.png
tyler@tyler-VirtualBox:~/src/temp$ ./node_modules/.bin/mmdc -v
error: unknown option `-v'
tyler@tyler-VirtualBox:~/src/temp$ ./node_modules/.bin/mmdc -V
0.4.6
tyler@tyler-VirtualBox:~/src/temp$
I am not going to test other Linux distributions because there are so many of them. If it doesn't work for your distribution, it's probably not mermaid.cli's issue.
When executing
mmdc -i my_file.mmd
with node 6.11.5 in mermaidCLI 0.3.1, the following exception happens:Same issue when using node 8 and 9
The minimal file I tried: