0
186 verbose stack SyntaxError: Unexpected end of input at 1:21464
186 verbose stack ,"tarball":"https://registry.npmjs.org/autoprefixer/-/autoprefixer-0.
186 verbose stack                                                                      ^
186 verbose stack     at Object.parseJSON (C:\Users\admin\AppData\Roaming\nvm\v8.0.0\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-helpfulerror\node_modules\jju\lib\parse.js:745:13)
186 verbose stack     at parse (C:\Users\admin\AppData\Roaming\nvm\v8.0.0\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-helpfulerror\index.js:10:13)
186 verbose stack     at consumeBody.call.then.buffer (C:\Users\admin\AppData\Roaming\nvm\v8.0.0\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50)
186 verbose stack     at <anonymous>
186 verbose stack     at process._tickCallback (internal/process/next_tick.js:169:7)
187 verbose cwd C:\Users\admin
188 verbose Windows_NT 10.0.10586
189 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
190 verbose node v8.0.0
191 verbose npm  v5.0.0
192 error Unexpected end of input at 1:21464
192 error ,"tarball":"https://registry.npmjs.org/autoprefixer/-/autoprefixer-0.
192 error                                                                      ^
193 verbose exit [ 1, true ]


Nvm is managing my node versions , it ran in my laptop some weeks before.


Update

After npm cache clean and installing cli again it gives me this error

12472 verbose enoent SKIPPING OPTIONAL DEPENDENCY:
12473 warn optional SKIPPING OPTIONAL DEPENDENCY: colormin@1.1.2 (node_modules\@angular\cli\node_modules\colormin):
12474 warn enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open 'C:\Users\admin\AppData\Roaming\npm\node_modules\.staging\colormin-49f667bd\dist\lib\stripWhitespace.js'
12475 verbose enoent SKIPPING OPTIONAL DEPENDENCY: This is related to npm not being able to find a file.
12475 verbose enoent SKIPPING OPTIONAL DEPENDENCY:
12476 verbose stack Error: sha1-CWkdCXOjCtH4Ksc6EuIIfwpHVPk= integrity checksum failed when using sha1: wanted sha1-CWkdCXOjCtH4Ksc6EuIIfwpHVPk= but got sha1-SgdXJPMGxLuMFjYV7TnO68+L+3c=. (4997 bytes)
12476 verbose stack     at Transform.on (C:\Users\admin\AppData\Roaming\nvm\v8.0.0\node_modules\npm\node_modules\ssri\index.js:275:19)
12476 verbose stack     at emitNone (events.js:110:20)
12476 verbose stack     at Transform.emit (events.js:207:7)
12476 verbose stack     at endReadableNT (_stream_readable.js:1045:12)
12476 verbose stack     at _combinedTickCallback (internal/process/next_tick.js:102:11)
12476 verbose stack     at process._tickCallback (internal/process/next_tick.js:161:9)
12477 verbose cwd C:\Users\admin
12478 verbose Windows_NT 10.0.10586
12479 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
12480 verbose node v8.0.0
12481 verbose npm  v5.0.0
12482 error code EINTEGRITY
12483 error sha1-CWkdCXOjCtH4Ksc6EuIIfwpHVPk= integrity checksum failed when using sha1: wanted sha1-CWkdCXOjCtH4Ksc6EuIIfwpHVPk= but got sha1-SgdXJPMGxLuMFjYV7TnO68+L+3c=. (4997 bytes)
12484 verbose exit [ 1, true ]

don't know why it is throwing errors like this, any help will be much appreciated , thanks.

Sachin
  • 2,627
  • 1
  • 19
  • 35
  • are you using standard npm repository or it is a private npm repository ? – Parham Alvani Jun 23 '17 at 04:29
  • it should the standard one, i done nothing on that. – Sachin Jun 23 '17 at 04:30
  • Possible duplicate of [Integrity checksum failure while installing API Connect toolkit #apiconnect](https://stackoverflow.com/questions/44331813/integrity-checksum-failure-while-installing-api-connect-toolkit-apiconnect) – kenorb Feb 18 '19 at 12:10

2 Answers2

6

I ran into the same issue - the latest version of npm uses self healing cache.
All you need to do is run:

npm cache verify

After that run:

npm i -g @angular/cli

That did the trick for me

Community
  • 1
  • 1
0

I was having a problem installing the Angular CLI with npm and found that I needed to disable auth in my .npmrc file.

HisDivineShadow
  • 1,036
  • 1
  • 12
  • 21