Recently I was trying to make a new Module using nest generate module, unluckily it is not working for me and it is showing me the error: Error: Unknown argument skipImport. Did you mean skip-import in NestJS.
I tried multiple methods to fix the error, I would be sharing the methods which worked for me to fix the Error: Unknown argument skipImport. Did you mean skip-import in NestJS.
Why Error: Unknown argument skipImport. Did you mean skip-import Occurred?
Error: Unknown argument skipImport. Did you mean skip-import is basically seen in NestJS 8.2.7 version. NestJS version 8.2.7 is having some bug that is causing the Error: Unknown argument skipImport. Did you mean skip-import.
How to Fix Error: Unknown argument skipImport. Did you mean skip-import?
To fix the Error, either upgrade your NestJS version to the latest available version or downgrade the NestJS version to any other version from 8.2.7 version which doesn’t have the bug. It would solve the Error: Unknown argument skipImport. Did you mean skip-import for you.
Below is the step by step process to upgrade or downgrade the NestJS version to fix the Error: Unknown argument skipImport. Did you mean skip-import:
Fix 1: Downgrade the NestJS to 8.2.6 Version
To downgrade the NestJS version to 8.2.6, first uninstall the NestJS version using below command:
npm uninstall -g @nestjs/cli
Now install the NestJS 8.2.6 version to fix the error using below command:
npm install -g nestjs/cli@8.2.6
It would solve the error for you immediately.
Fix 2: Upgrade the NestJS to 8.2.8 Version
To downgrade the NestJS version to 8.2.8, first uninstall the NestJS version using below command:
npm uninstall -g @nestjs/cli
Now install the NestJS 8.2.8 version to fix the error using below command:
npm install -g nestjs/cli@8.2.8
It would solve the error for you immediately.
Conclusion
To fix the Error, either upgrade your NestJS version to the latest available version using command npm install -g nestjs/cli@8.2.8 or downgrade the NestJS to one version from 8.2.7 version using command npm install -g nestjs/cli@8.2.6 which doesn’t have the bug.
It would solve the Error: Unknown argument skipImport. Did you mean skip-import for you immediately.