DIfficulties installing polymer-cli

I’m posting this here, in case someone has had similar troubles.

I’ve started here:


My first task was to figure out what npm is - it’s a package manager for node.js. Fair enough,

apt-get install npm

Now follow the instructions:

npm install -g polymer-cli@next

The result being:

pi@dhammapi:~/next-sc $ sudo npm install -g polymer-cli@next
npm WARN engine polymer-cli@0.18.0: wanted: {"node":">=6.0"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'types/findup-sync' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'polymer-cli'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Linux 4.4.50-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "polymer-cli@next"
npm ERR! cwd /home/pi/next-sc
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/next-sc/npm-debug.log
npm ERR! not ok code 0

So then, tried this:

pi@dhammapi:~/next-sc $ sudo npm install -g findup-sync
findup-sync@1.0.0 /usr/local/lib/node_modules/findup-sync
├── is-glob@2.0.1 (is-extglob@1.0.0)
├── detect-file@0.1.0 (fs-exists-sync@0.1.0)
├── resolve-dir@0.1.1 (expand-tilde@1.2.2, global-modules@0.2.3)
└── micromatch@2.3.11 (filename-regex@2.0.0, array-unique@0.2.1, is-extglob@1.0.0, extglob@0.3.2, arr-diff@2.0.0, normalize-path@2.1.1, expand-brackets@0.1.5, regex-cache@0.4.3, kind-of@3.1.0, object.omit@2.0.1, parse-glob@3.0.4, braces@1.8.5)

But that fixed nowt.

Best to ask @Blake I guess. I had no problems but used sudo for the npm install also.
Note however that most packages for Polymer are not yet updated to 2.0.

You need a more modern version of Node, personally I installed https://github.com/creationix/nvm so that the node is installed at the user level instead of system, then you don’t need to sudo install anything. You should be able to just use the “Install script” method to install it, then nvm install node, IIRC that’s all that needs to be done to have an up to date version of node. Then you can install polymer-cli and stuff using npm without using sudo.

1 Like

I got nvm working, installed node. What is the polymer 2.0 rc package I need to get? polymer-cli@next could not be found.

Also, I followed the new developer wiki page and installed/ran the python code. All good. We should add polymer-cli and bower to the instructions.

OK, lunch time. :smile:

The package you need is just polymer-cli, it’s not specific to any version of polymer, you can create a polymer1.0 or 2.0 project with it.

My mistake was thinking that nvm is a separate package manager. I was running nvm install polymer-cli@next. The good folks over at http://polymer.slack.com set me straight.

Still stuck… I can install it now, with a few warnings:

npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

Then running polymer --version

polymer: command not found

Well, a less than productive day today. :confused:

What about the -g flag? Better not to use it?

Right… this is what you do:

Install nvm following @blake’s instructions and install node
Install npm - I think just did apt-get install npm
Get the next-sc code from github.
Now - really important - cd into the project directory sc_next
Run this command npm install -g polymer-cli(Don’t use sudo or you’ll need it every time)
To confirm the install polymer --version
I got 0.18.1

So, that’s that. Would you like me to add this info to the wiki page?

1 Like