1
votes

I just received Z_BUF_ERROR while installing NativeScript. I did Google but without any luck.

Environment:

  • Windows 10 Enterprise 1703 64-bit
  • NodeJS v6.11.2
  • npm v5.3.0

Command:

  • npm install -g nativescript

Error Log:

  • 0 info it worked if it ends with ok
  • 1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
  • 1 verbose cli 'C:\Users\Hui\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
  • 1 verbose cli 'install',
  • 1 verbose cli '-g',
  • 1 verbose cli 'nativescript' ]
  • 2 info using [email protected]
  • 3 info using [email protected]
  • 4 verbose npm-session 4454628f9775be96
  • 5 silly install loadCurrentTree
  • 6 silly install readGlobalPackageData
  • 7 http fetch GET 200 https://registry.npmjs.org/nativescript 1244ms
  • 8 http fetch GET 200 https://registry.npmjs.org/nativescript/-/nativescript-3.1.3.tgz 23ms (from cache)
  • 9 silly fetchPackageMetaData error for nativescript@latest unexpected end of file
  • 10 verbose stack Error: unexpected end of file
  • 10 verbose stack at Zlib._handle.onerror (zlib.js:370:17)
  • 11 verbose cwd D:\Dev\Workspace\Local\Angular
  • 12 verbose Windows_NT 10.0.15063 13 verbose argv "C:\Program Files\nodejs\node.exe" - "C:\Users\Hui\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "nativescript"
  • 14 verbose node v6.11.2
  • 15 verbose npm v5.3.0
  • 16 error code Z_BUF_ERROR
  • 17 error errno -5
  • 18 error unexpected end of file
  • 19 verbose exit [ -5, true ]

Any help would be appreciated.

1
Few suggestions - 1.) try to clean your npm cache (npm cache clean) and then retry the installation - you can also try to install a lower version of npm. 2.) Disable any antivirus before trying to install NativeScript. 3.) Post your actual error logNick Iliev
@Nick, thanks for your response. 1) I just found this from npm official doc ''It should never be necessary to clear the cache for any reason other than reclaiming disk space, thus why clean now requires --force to run.". I am not sure I really need to do this. My peer installed without such error by using Node JS 8.x.x, a higher version then mine. I also tried 8.x.x, same error. 2) I will try to disable the antivirus before installing. 3) This is the whole content I copied from the log file.Hui

1 Answers

0
votes

try to clean cache by using this

npm cache clean --force