-1

command i used 'npm install -g polymer-cli'

'npm config list' returns this

; cli configs
registry = "https://registry.npmjs.org/"

; userconfig /root/.npmrc
strict-ssl = false

; builtin config undefined
# DO NOT MODIFY THIS FILE - use /etc/npmrc instead. = true
globalconfig = "/etc/npmrc"
globalignorefile = "/etc/npmignore"
prefix = "/usr/local"

; node bin location = /usr/bin/nodejs
; cwd = /root
; HOME = /root
; 'npm config ls -l' to show all defaults.

git --verision
1.9.1

node --version v0.10.25

npm --version 1.3.10

problem: polymer --version says

polymer command not found

i want install polymer

these are the errors i got

npm ERR! Error: Invalid name: "@babel/helper-optimise-call-expression"
npm ERR!     at ensureValidName (/usr/lib/nodejs/normalize-package-data/lib/fixer.js:284:15)
npm ERR!     at Object.module.exports.fixNameField (/usr/lib/nodejs/normalize-package-data/lib/fixer.js:199:5)
npm ERR!     at /usr/lib/nodejs/normalize-package-data/lib/normalize.js:29:38
npm ERR!     at Array.forEach (native)
npm ERR!     at normalize (/usr/lib/nodejs/normalize-package-data/lib/normalize.js:28:15)
npm ERR!     at final (/usr/lib/nodejs/read-package-json/read-json.js:310:33)
npm ERR!     at then (/usr/lib/nodejs/read-package-json/read-json.js:124:33)
npm ERR!     at /usr/lib/nodejs/read-package-json/read-json.js:234:40
npm ERR!     at fs.js:268:14
npm ERR!     at /usr/lib/nodejs/graceful-fs/graceful-fs.js:103:5
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.13.0-119-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "polymer-cli"
npm ERR! cwd /root
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10

1 Answers1

0

this could be a problem due to incompatibility between the npm version and the package you try to install, which is polymer-cli. You are using extre old version of all those packages. I suggest you run an update on all packages: node, git, npm.

Updating node - original answer:

  • Install n:

sudo npm install -g n

  • Then run:

sudo n latest

Updating npm:

  • Run:

sudo npm install -g npm

Updating git - original answer:

  • Run these commands in order:

    sudo add-apt-repository ppa:git-core/ppa
    sudo apt-get update
    sudo apt-get install git
    
  • Then, check the version of the installed Git:

git --version

  • It's not always necessary to remove the existing Git before upgrading it, but if you run into any problems, do the following and then repeat the steps mentioned above:

sudo apt-get remove git

When you're all one with these, try npm install -g polymer-cli again and send me your result.

Binh Bui
  • 343
  • 1
  • 8