Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Failed to download Chromium when installing #5

Open
Bad-Science opened this issue Nov 11, 2018 · 2 comments
Open

ERROR: Failed to download Chromium when installing #5

Bad-Science opened this issue Nov 11, 2018 · 2 comments

Comments

@Bad-Science
Copy link

Getting this error trying to install via npm. Tried setting the environment variable to skip the chromium download but it didn't seem to have any effect.

macOS: 10.13.6
npm: 5.6.0
node: v8.11.3

$ sudo npm install -g hardcider

Password:
/usr/local/bin/hardcider -> /usr/local/lib/node_modules/hardcider/bin/hardcider.js

> puppeteer@1.10.0 install /usr/local/lib/node_modules/hardcider/node_modules/puppeteer
> node install.js

ERROR: Failed to download Chromium r599821! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/hardcider/node_modules/puppeteer/.local-chromium'
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/usr/local/lib/node_modules/hardcider/node_modules/puppeteer/.local-chromium' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer@1.10.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the puppeteer@1.10.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@aeksco
Copy link
Owner

aeksco commented Nov 11, 2018

Looks like this is a Node.js permission issue for global installations - run the following command on your local system to find the value of your npm prefix configuration variable:

$ npm config get prefix

/home/aeksco/npm-global

So if my prefix directory is /home/aeksco/npm-global, I would run the following command to change the owner of that directory:

sudo chown -R aeksco:aeksco /home/aeksco/npm-global

What's happening here? The chown command will change the owner a file or directory. The -R flag recursively changes ownership of all files and sub-directories. The next argument is the user and group that will be the new owner, where the first aeksco is my username, and the second aeksco is the GNU/Linux User Group associated with my user. Lastly the /home/aeksco/npm-global is the path to the directory where ownership will be changed.

@Bad-Science Post an update if that fixes the problem!

@Bad-Science
Copy link
Author

Hmmmm I already tried chown'ing my /usr/local/lib/node_modules and subdirectories, which is where it's trying to create the file. I don't have an npm-global directory anywhere on my machine, and npm config get prefix just returns /usr/local. It seems like this is probably out of this scope for this project now and probably a general issue with installing puppeteer. I'll look more into this when I have a chance and comment back here in case anyone else has a similar problem with puppeteer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants