9

Hi all I am getting the following error while trying to install a package via npm. The operating system i am using for this is windows 8. It works perfectly on Ubuntu. Please help me resolve this issue.

C:\Users\xxxxx>npm install -g jshint

npm ERR! registry error parsing json

npm ERR! Windows_NT 6.3.9600 

npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\node\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "jshint"

npm ERR! node v0.12.4

npm ERR! npm  v2.10.1

npm ERR! Unexpected token <

npm ERR! <html>

npm ERR! <head>

npm ERR! </head>

npm ERR! <body>

npm ERR! We are sorry but this is temporarily unavailable.

npm ERR! <!-- Site Not Found. -->

npm ERR! </body>

npm ERR! </html>

npm ERR!

npm ERR!

npm ERR! If you need help, you may report this error at:

npm ERR!     <https://github.com/npm/npm/issues>


npm ERR! Please include the following file with any support request:

npm ERR!     C:\Users\xxxxx\npm-debug.log
Rahul
  • 702
  • 2
  • 8
  • 26
  • 1
    Seems like you have a `package.json` file in the same directory that is not valid JSON. – Explosion Pills Jun 22 '15 at 20:05
  • no. i have no package.json in the directory. i have taken care of that. however i am installing jshint globally using -g option. – Rahul Jun 22 '15 at 20:08

4 Answers4

6

I got a solution for this question (at least in my case). The url for the registry was out dated. Please see this link: Can't install any packages in Node.js using "npm install"

Thank you.

Community
  • 1
  • 1
Rahul
  • 702
  • 2
  • 8
  • 26
2

In my case , Upgrading npm on Windows requires manual steps to ensure that PowerShell/CMD find the new version of npm. This is a small tool made by Microsoft DX engineers with for npm and Node, reducing the process to a simple command. For more detail view npm-windows-upgrade

Shailesh Singh
  • 421
  • 2
  • 8
1

You can use this step

1. install latest node js from https://nodejs.org/en/
2.Run CMD with "Run as Administrator"
3.npm install -g angular-cli

It will run

0

I solved the issue by rolling back to an earlier version of node

  1. nvm ls (to see versions of node installed)

  2. nvm use *.** (choose version to use)