Error while running npm run optimize in extractected webviewer folder

I downloaded webviewer and extracted the zip file. As per documentation when i tried to run npm run optimize I am getting below error

D:\PdfTron\WebViewer>npm run optimize

> webviewer@8.4.1 optimize
> node scripts/optimize-for-prod.js

  throw err;

Error: Cannot find module 'command-line-args'
Require stack:
- D:\PdfTron\WebViewer\scripts\optimize-for-prod.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (D:\PdfTron\WebViewer\scripts\optimize-for-prod.js:4:25)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
  requireStack: [ 'D:\\PdfTron\\WebViewer\\scripts\\optimize-for-prod.js' ]

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


Hello @mari

You need to install the node packages with npm i before running the optimization script. Did you run it before?