amehime / hexo-theme-shoka

Just For https://shoka.lostyu.me/
MIT License
896 stars 206 forks source link

Bug 回報及尋求支援 #32

Open LeeChunHao2000 opened 3 years ago

LeeChunHao2000 commented 3 years ago

@amehime 博主姊姊您好, 反饋三件事情: 一、Mac M1在安裝puppeteer(multi-markdown-it)的時候會遇到以下問題: https://github.com/puppeteer/puppeteer/issues/6622 -- ignore-scripts 後有安裝成功 二、leancloud我在按照教學設置了白名單後依舊沒有得到解決,此外localhost的環境也會出現跨域報錯 三、不曉得是不是multi-markdown-it的問題,highlight: enable: false會產生文末錯誤,而直接設置成true後渲染又會不完 整,然而神奇的是我先設置成false令他報錯一次後再設置成true就能成功compile了

    最後,感謝姊姊的時間!

文末錯誤:

FATAL {
   err: Error: Could not locate the bindings file. Tried:
   → /Users/brendan/Desktop/defat/node_modules/deasync/build/deasync.node
   → /Users/brendan/Desktop/defat/node_modules/deasync/build/Debug/deasync.node
   → /Users/brendan/Desktop/defat/node_modules/deasync/build/Release/deasync.node
   → /Users/brendan/Desktop/defat/node_modules/deasync/out/Debug/deasync.node
   → /Users/brendan/Desktop/defat/node_modules/deasync/Debug/deasync.node
   → /Users/brendan/Desktop/defat/node_modules/deasync/out/Release/deasync.node
   → /Users/brendan/Desktop/defat/node_modules/deasync/Release/deasync.node
   → /Users/brendan/Desktop/defat/node_modules/deasync/build/default/deasync.node
   → /Users/brendan/Desktop/defat/node_modules/deasync/compiled/15.14.0/darwin/arm64/deasync.node
   → /Users/brendan/Desktop/defat/node_modules/deasync/addon-build/release/install-root/deasync.node
   → /Users/brendan/Desktop/defat/node_modules/deasync/addon-build/debug/install-root/deasync.node
   → /Users/brendan/Desktop/defat/node_modules/deasync/addon-build/default/install-root/deasync.node
   → /Users/brendan/Desktop/defat/node_modules/deasync/lib/binding/node-v88-darwin-arm64/deasync.node
      at bindings (/Users/brendan/Desktop/defat/node_modules/bindings/bindings.js:126:9)
      at Object.<anonymous> (/Users/brendan/Desktop/defat/node_modules/deasync/index.js:30:31)
      at Module._compile (node:internal/modules/cjs/loader:1092:14)
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
      at Module.load (node:internal/modules/cjs/loader:972:32)
      at Function.Module._load (node:internal/modules/cjs/loader:813:14)
      at Module.require (node:internal/modules/cjs/loader:996:19)
      at require (node:internal/modules/cjs/helpers:92:18)
      at Object.<anonymous> (/Users/brendan/Desktop/defat/node_modules/deasync-promise/index.js:1:12)
      at Module._compile (node:internal/modules/cjs/loader:1092:14)
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
      at Module.load (node:internal/modules/cjs/loader:972:32)
      at Function.Module._load (node:internal/modules/cjs/loader:813:14)
      at Module.require (node:internal/modules/cjs/loader:996:19)
      at require (node:internal/modules/cjs/helpers:92:18)
      at mermaidChart (/Users/brendan/Desktop/defat/node_modules/hexo-renderer-multi-markdown-it/lib/renderer/markdown-it-mermaid/index.js:2:28)
      at Object.md.renderer.rules.fence (/Users/brendan/Desktop/defat/node_modules/hexo-renderer-multi-markdown-it/lib/renderer/markdown-it-mermaid/index.js:68:20)
      at Object.md.renderer.rules.fence (/Users/brendan/Desktop/defat/node_modules/hexo-renderer-multi-markdown-it/lib/renderer/markdown-it-graphviz/index.js:26:12)
      at Object.md.renderer.rules.fence (/Users/brendan/Desktop/defat/node_modules/hexo-renderer-multi-markdown-it/lib/renderer/markdown-it-prism/index.js:112:20)
      at Object.md.renderer.rules.fence (/Users/brendan/Desktop/defat/node_modules/hexo-renderer-multi-markdown-it/lib/renderer/markdown-it-chart/index.js:29:16)
      at Renderer.render (/Users/brendan/Desktop/defat/node_modules/markdown-it/lib/renderer.js:326:38)
      at MarkdownIt.render (/Users/brendan/Desktop/defat/node_modules/markdown-it/lib/index.js:543:24) {
    tries: [
      '/Users/brendan/Desktop/defat/node_modules/deasync/build/deasync.node',
      '/Users/brendan/Desktop/defat/node_modules/deasync/build/Debug/deasync.node',
      '/Users/brendan/Desktop/defat/node_modules/deasync/build/Release/deasync.node',
      '/Users/brendan/Desktop/defat/node_modules/deasync/out/Debug/deasync.node',
      '/Users/brendan/Desktop/defat/node_modules/deasync/Debug/deasync.node',
      '/Users/brendan/Desktop/defat/node_modules/deasync/out/Release/deasync.node',
      '/Users/brendan/Desktop/defat/node_modules/deasync/Release/deasync.node',
      '/Users/brendan/Desktop/defat/node_modules/deasync/build/default/deasync.node',
      '/Users/brendan/Desktop/defat/node_modules/deasync/compiled/15.14.0/darwin/arm64/deasync.node',
      '/Users/brendan/Desktop/defat/node_modules/deasync/addon-build/release/install-root/deasync.node',
      '/Users/brendan/Desktop/defat/node_modules/deasync/addon-build/debug/install-root/deasync.node',
      '/Users/brendan/Desktop/defat/node_modules/deasync/addon-build/default/install-root/deasync.node',
      '/Users/brendan/Desktop/defat/node_modules/deasync/lib/binding/node-v88-darwin-arm64/deasync.node'
    ]
  }
}
LeeChunHao2000 commented 3 years ago

針對第一點和第三點問題我找到解決辦法了!方法如下:

brew install chromium
`which chromium`

會收到安全警告。 這時到 “系統偏好設置”>“安全性和隱私”>“一般”>然後單擊“強制打開”。

將以下指令加到~/.zshrc

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=`which chromium`

重啟Terminal

之後重新安裝 hexo-renderer-multi-markdown-it 即可

npm un hexo-renderer-multi-markdown-it --save
npm i hexo-renderer-multi-markdown-it --save 

參考: https://github.com/puppeteer/puppeteer/issues/6622#issuecomment-788199984