BlueHatbRit / mdpdf

Markdown to PDF command line app with support for stylesheets

Home Page:https://npmjs.com/package/mdpdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cant install in debian stretch

guilhermedelyra opened this issue · comments

running:
~$ sudo npm install mdpdf -g
outputs:

/usr/bin/mdpdf -> /usr/lib/node_modules/mdpdf/bin/index.js

> puppeteer@1.16.0 install /usr/lib/node_modules/mdpdf/node_modules/puppeteer
> node install.js

ERROR: Failed to download Chromium r656675! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/mdpdf/node_modules/puppeteer/.local-chromium'
  -- ASYNC --
    at BrowserFetcher.<anonymous> (/usr/lib/node_modules/mdpdf/node_modules/puppeteer/lib/helper.js:110:27)
    at Object.<anonymous> (/usr/lib/node_modules/mdpdf/node_modules/puppeteer/install.js:64:16)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path:
   '/usr/lib/node_modules/mdpdf/node_modules/puppeteer/.local-chromium' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer@1.16.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the puppeteer@1.16.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-05-15T16_31_30_544Z-debug.log

Hm, this is one people seem to have run across in the past but I can never seem to recreate it. It looks to be an issue for a lot of npm global installs across numerous modules. I've seen some people having success with this approach before gdotdesign/elm-github-install#21 (comment)

Essentially, create the directory it's failing to create, and chown it for yourself. Don't forget to rever it though.

Let me know if this works while I try to recreate this. I've honestly no idea what the issue is though, I'll keep trying to figure it out!

--unsafe-perm did the trick for me too, here the actual command:
npm install -g mdpdf --unsafe-perm=true
taken from here: puppeteer/puppeteer#367 (comment)