polymer-cli installation failure on Ubuntu
Asked Answered
T

7

5

No matter what I try, every time I try to install polymer-cli, it always comes up with a PERMISSION_DENIED error.

bradley@gurulaptop:~$ sudo npm -g install polymer-cli
npm WARN deprecated [email protected]: ..psst! While Bower is maintained, we recommend Yarn and Webpack for *new* front-end projects! Yarn's advantage is security and reliability, and Webpack's is support for both CommonJS and AMD projects. Currently there's no migration path but we hope you'll help us figure out one.
npm WARN deprecated @types/[email protected]: See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/12826
/usr/bin/polymer -> /usr/lib/node_modules/polymer-cli/bin/polymer.js

> [email protected] install /usr/lib/node_modules/polymer-cli/node_modules/wd
> node scripts/build-browser-scripts

/usr/lib/node_modules/polymer-cli/node_modules/mkdirp/index.js:90
                    throw err0;
                    ^

Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/polymer-cli/node_modules/wd/build'
    at Object.fs.mkdirSync (fs.js:877:18)
    at sync (/usr/lib/node_modules/polymer-cli/node_modules/mkdirp/index.js:71:13)
    at Object.<anonymous> (/usr/lib/node_modules/polymer-cli/node_modules/wd/scripts/build-browser-scripts.js:6:1)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node scripts/build-browser-scripts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /home/bradley/.npm/_logs/2017-06-06T13_10_23_400Z-debug.log

How can I solve this?

Tartrazine answered 6/6, 2017 at 13:17 Comment(0)
B
9

I faced the same problem and followed @Tim Lundqvist's answer and solved by the following way:

Step 1: Create a hidden folder in home. Commands:

$ cd ~
$ mkdir .polymer-patch
$ cd .polymer-patch
$ npm install polymer-cli

Step 2: create symbolic links to make it executables

$ sudo ln -s "$(readlink -f ~/.polymer-patch/node_modules/.bin/wd)" /usr/bin/wd
$ sudo ln -s "$(readlink -f ~/.polymer-patch/node_modules/.bin/polymer)" /usr/bin/polymer
$ polymer

Now polymer CLI is working for me.


Updated

This issue is node and npm version related but the following command works good

$ sudo npm install --unsafe-perm -g polymer-cli
Britannia answered 2/8, 2017 at 6:41 Comment(0)
M
2

There seems to be a problem installing the package wd as root. One way to work around this fact is to do a non global npm install of polymer-cli and use the local bin path.

$ cd ~
$ npm install polymer-cli
$ ~/node_modules/.bin/polymer --version
1.1.0

After which you may either copy all dependencies to /usr/lib/node_modules and /usr/bin/ or create symbolic links to the executables (which may be easier for a singe user system).

$ sudo ln -s "$(readlink -f ~/node_modules/.bin/wd)" /usr/bin/wd
$ sudo ln -s "$(readlink -f ~/node_modules/.bin/polymer)" /usr/bin/polymer

When the path /usr/bin/polymer exists you should be able to use the polymer command as expected.

Mefford answered 8/6, 2017 at 0:15 Comment(0)
R
2

I'm running Xubuntu, this worked

sudo npm install -g polymer-cli --unsafe-perm=true --allow-root

Rita answered 25/5, 2018 at 21:10 Comment(0)
G
1

I got myself in the same situation. I could not install or update to the latest polymer-cli version (1.2.0). The two previous answers didn't help me at all. My solution was the downgrade of npm. I had installed:

node -v: v7.x.x
npm  -v: v5.x.x

And that was the real problem. After downgrading to npm 4.x.x by:

 sudo npm install -g [email protected]

I was able to install the latest polymer-cli via:

sudo npm install -g polymer-cli
Godinez answered 24/6, 2017 at 13:38 Comment(0)
C
0

Maybe you need previous also to uninstall the old wd & polymer-cli unifinished installation:

sudo npm uninstall -g wd polymer-cli
sudo rm /usr/bin/polymer

That work now for me with the tips of Tim and the same start bug after this clean up

Conga answered 12/6, 2017 at 15:57 Comment(0)
P
0

Solved the issue: polymer-cli global install error

sudo npm install -g polymer-cli --unsafe-perm
Pyrrhonism answered 15/11, 2017 at 13:4 Comment(0)
S
0

I had the same problem, I tried different things, but what finally helped me was this:

sudo npm install -g yarn

(Consider Yarn and Webpack or Parce)

Seating answered 31/7, 2018 at 7:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.