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

ProcessError: fatal: could not create work tree dir, Permission denied #9

Closed
gkucmierz opened this issue Feb 19, 2017 · 11 comments
Closed
Assignees

Comments

@gkucmierz
Copy link

gkucmierz commented Feb 19, 2017

MacBook-Pro-gkucmierz:coin-tools gkucmierz$ ngh --no-silent
Cloning [email protected]:gkucmierz/coin-tools.git into ../../../../usr/local/lib/node_modules/angular-cli-ghpages/node_modules/gh-pages/.cache

An error occurred!

(node:17668) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): ProcessError: fatal: could not create work tree dir '../../../../usr/local/lib/node_modules/angular-cli-ghpages/node_modules/gh-pages/.cache': Permission denied
@JohannesHoppe JohannesHoppe changed the title I cant deploy page ProcessError: fatal: could not create work tree dir, Permission denied Feb 19, 2017
@JohannesHoppe
Copy link
Member

JohannesHoppe commented Feb 19, 2017

ProcessError: fatal: could not create work tree dir '../../../../usr/local/lib/node_modules/angular-cli-ghpages/node_modules/gh-pages/.cache': Permission denied

Hmmm... strange. I'm not on a Mac, so I can't reproduce.
The .cache directory does not have the write/create permission to create the repo.

Please try this as a quick workaround:
sudo chown -R **yourusername** /usr/local/lib/node_modules/angular-cli-ghpages/node_modules/gh-pages/.cache
(as seen here http://stackoverflow.com/a/23151665/2042765)

@JohannesHoppe
Copy link
Member

@fmalcher can you kick in, when you have some spare time?

@JohannesHoppe
Copy link
Member

see also tschaub/gh-pages#118

@JohannesHoppe
Copy link
Member

JohannesHoppe commented Feb 19, 2017

we could also add the --clone parameter to our command, to avoid this at all https://github.com/tschaub/gh-pages#optionsclone

@gkucmierz
Copy link
Author

Thank you!
Looks like this one worked for me:

sudo chown -R **yourusername** /usr/local/lib/node_modules/angular-cli-ghpages/node_modules/gh-pages/

@JohannesHoppe
Copy link
Member

Fixed in gh-pages, see nkbt/react-works@7b0a9e0 and tschaub/gh-pages#118

TODO: test & update new version of gh-pages

@MurhafSousli
Copy link

@gkucmierz sudo ngh worked for me

@tomGdow
Copy link

tomGdow commented Sep 16, 2017

sudo chown -R **username"" /usr/lib/node_modules/angular-cli-ghpages/node_modules/gh-pages/

also worked for me (Angular 4). Thanks!

@JohannesHoppe
Copy link
Member

I tested this out on CircleCI 2.0 and it works flawlessly via npx. (Nodejs 8 or higher required)
No sudo required.

npm i angular-cli-ghpages --save-dev
npx ngh [OPTIONS]

@DIPCHANDAN
Copy link

atal: could not create work tree dir '/usr/share/doc/hacktronian': Permission denied

@devopsean
Copy link

Try changing the directories

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

No branches or pull requests

7 participants