I am attempting to use reveal-md to generate slide decks using markdown files. I followed the instructions to install reveal-md using npm npm install -g reveal-md.

One of the optional dependencies is puppeteer, which is a library that interfaces with Chrome/Chromium API's, and allows the user to print a slide deck to PDF.

reveal-md was installed successfully, but I get this error for puppeteer in my terminal:

ERROR: Failed to download Chromium r549031! Set 
"PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: EACCES: permission denied, mkdir 
'/usr/lib/node_modules/reveal-md/node_modules/puppeteer/.local-chromium'
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/usr/lib/node_modules/reveal-md/node_modules/puppeteer/.local-chromium' }
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 
(node_modules/reveal-md/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: puppeteer@1.3.0 (node_modules/reveal-md/node_modules/puppeteer):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: puppeteer@1.3.0 install: `node install.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

When I installed puppeteer manually via npm install -g puppeteer, I get a similar error:

ERROR: Failed to download Chromium r588429! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/puppeteer/.local-chromium'
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/usr/lib/node_modules/puppeteer/.local-chromium' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer@1.8.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the puppeteer@1.8.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/2018-09-13T00_07_56_867Z-debug.log

I even tried promoting myself to the root user and attempting the install command, but I received the same error.

I did a web search for "npm install puppeteer error," and I have seen several comments that this is probably an issue with npm permission. Is there a way I can fix this manually?

UPDATE 9/14/18:

The answer by @rmmcneely, below, is correct to fix my specific error. As a more permanent solution, I followed npm's instructions for changing the global prefix, in the config file, to point to a location I created in my home folder ~/.npm-global, which solves any permission issues with global packages.

Option 2

  1. Back-up your computer before you start.
  2. Make a directory for global installations: mkdir ~/.npm-global
  3. Configure npm to use the new directory path: npm config set prefix '~/.npm-global'
  4. Open or create a ~/.profile file and add this line: export PATH=~/.npm-global/bin:$PATH
  5. Back on the command line, update your system variables: source ~/.profile
  6. Test: Download a package globally without using sudo. npm install -g jshint
up vote 0 down vote accepted

EACCES indicates a permission error generally, double check who owns your global node_modules folder in /usr/lib and try to either install with those permissions, or chown the dir.

  • Thanks @rmmcneely! I ended up changing my npm prefix to my home folder ~/.npm-global, following the instructions in npm's documentation. – Audiosyncrasy Sep 14 at 15:37

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.