JozoVilcek / gitbook-plugin-mermaid

Apache License 2.0
127 stars 22 forks source link

launch gitbook throw err "Error: Could not locate the bindings file. " #23

Open ghost opened 8 years ago

ghost commented 8 years ago

There is some problem after i install gitbook-plugin-mermaid. How can i resolve this err?

Here is the Content of README.md:

# Introduction

{% mermaid %}

{% endmermaid%}

here is load log:

info: loading book configuration....OK 
info: load plugin gitbook-plugin-mermaid ....OK 
info: load plugin gitbook-plugin-katex ....OK 
info: load plugin gitbook-plugin-puml ....OK 
info: load plugin gitbook-plugin-todo ....OK 
info: load plugin gitbook-plugin-highlight ....OK 
info: load plugin gitbook-plugin-search ....OK 
info: load plugin gitbook-plugin-sharing ....OK 
info: load plugin gitbook-plugin-fontsettings ....OK 
info: load plugin gitbook-plugin-livereload ....OK 
info: >> 9 plugins loaded 
/Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/node_modules/bindings/bindings.js:91
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/build/weakref.node
 → /Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/build/Debug/weakref.node
 → /Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/build/Release/weakref.node
 → /Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/out/Debug/weakref.node
 → /Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/Debug/weakref.node
 → /Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/out/Release/weakref.node
 → /Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/Release/weakref.node
 → /Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/build/default/weakref.node
 → /Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/compiled/6.2.1/darwin/x64/weakref.node
    at bindings (/Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/lib/weak.js:7:35)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at new D (/Users/iyuqi/Work/Indugration/gitbooks/org.omg/uml/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/index.js:28:20)
JozoVilcek commented 8 years ago

Sorry, I can not reproduce this. In my example, plugin works for me. Maybe it will help to compare with your setup: https://github.com/JozoVilcek/gitbook-example

JasonGao180 commented 8 years ago

@iyuqi I got the same error, and have a workaround to solve it. The error message says that it can not find the weakref.node, so decide to build it manually

npm install -g node-gyp
cd my-gitbook-doc-folder
cd node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak
node-gyp configure
node-gyp build

now the plugin will work perfectly.

@JozoVilcek thanks for your great plugin. do you have idea about why missing weakref.node

(english is foreign language for me)