polymer : command not found

1.7k Views Asked by At

I am using ubuntu 16.04. I have install polymer-cli npm install -g polymer-cli which is properly installed but when I enter command polymer server it is throwing error that polymer:command not found.

3

There are 3 best solutions below

5
daKmoR On

To check if a package is globally installed you can take a look at the npm root folder.

npm root -g will show you the root folder
ls $(npm root -g) therefore lists all public installed packages.

If you do not find polymer-cli there then your global installation was not successful... if you find it there but you still can not use it you probably want to try to reinstall it.

0
Marnix Harderwijk On

For me the answer relied in the fact that the bin folder of node wasn't defined in PATH.

The fix for me was to add it to the export PATH= part in my .zshrc-file or, if you don't use ZSH, .bash_profile. To know what to add to this PATH export run npm bin -g. For me the output was /usr/local/Cellar/node/11.14.0_1/bin. After this I opened my .zshrc-file and added the :/usr/local/Cellar/node/11.14.0_1/bin to the PATH definition. Notice the : which distinguishes a new location.

export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mysql/bin:/usr/local/Cellar/node/11.14.0_1/bin"

Good luck!

0
mariam tsartsidze On

If polymer-cli is globally installed successfully, change your path environment variable - add polymer.js' parent directory to it and polymer serve will work. You'll find polymer.js in .npm-global/bin