ivanblazevic / ngx-unused-css

Angular unused css detection
82 stars 16 forks source link

Error: Cannot find module 'tslib' #67

Open rbalet opened 2 years ago

rbalet commented 2 years ago

Description

I get a Error: Cannot find module 'tslib' while trying to run ngx-unused-css in my windows machine

Step to reproduce

  1. Use the latest version of vs-code
  2. Use the following shell https://git-scm.com/
  3. run npm install -g ngx-unused-css
  4. Go inside an angular project (v14) and add an empty .ngx-unused-css.json
  5. run ngx-unused-css

I then get

internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'tslib'
Require stack:
- C:\Users\xxx\AppData\Roaming\npm\node_modules\ngx-unused-css\dist\index.js
←[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:746:27)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:974:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:93:18)←[39m
    at Object.<anonymous> (C:\Users\xxx\AppData\Roaming\npm\node_modules\←[4mngx-unused-css←[24m\dist\index.js:5:15)
←[90m    at Module._compile (internal/modules/cjs/loader.js:1085:14)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:950:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:790:12)←[39m
←[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: [
    ←[32m'C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\ngx-unused-css\\dist\\index.js'←[39m
  ]
}
Rebaiahmed commented 2 years ago

The same issue happens to me! any update on how to fix this issue?

rbalet commented 2 years ago

@Rebaiahmed Sorry I can't help you, I just didn't use this library

Akram-Sayed commented 1 year ago

@Rebaiahmed any update for this issue