3

I need a workaround for updating polymer-cli on Ubuntu shell on Windows 10 which fails due to "...git: Permission denied".

I am following this running an Administrator Ubuntu shell on Windows 10.

All is well until $ sudo npm install -g polymer-cli which yields:

npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master git://github.com/polymerelements/test-fixture.git /home/<USERNAME>/.npm/_cacache/tmp/git-clone-fe296ee9
npm ERR! /home/<USERNAME>/.npm/_cacache/tmp/git-clone-fe296ee9/.git: Permission denied

I found this npm issue which may or may not be germane.

Thanks for the help.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • It looks like your global NPM installs to your local directory. What happens if you omit `sudo`? – Makoto Jun 07 '17 at 17:34
  • with NO sudo in Administrator shell:Error: EACCES: permission denied, access '/usr/lib/node_modules/polymer-cli/node_modules/@types/assert' ... Please try running this command again as root/Administrator. – Love and peace - Joe Codeswell Jun 07 '17 at 19:40

2 Answers2

0

I'm not sure what's causing this, but a workaround is to manually run the command and try again:

sudo /usr/bin/git clone --depth=1 -q -b master git://github.com/polymerelements/test-fixture.git /home/<USERNAME>/.npm/_cacache/tmp/git-clone-<HEX DIGITS FROM ERROR MESSAGE>
sudo npm install -g polymer-cli

Unfortunately, more permission issues occurred after this one. As such, I had to install polymer-cli in my app's local node_modules folder like so:

npm install polymer-cli
./node_modules/.bin/polymer --help
Deco
  • 5,112
  • 1
  • 16
  • 17
-1

try yarn.

yarn global add polymer-cli