In this tutorial, I will show you how to fix the error “cannot find module ‘jquery’ or its corresponding type declarations” that comes when developing a SharePoint framework crud operations with no javascript framework, I got the error while I tried to run the below command:
gulp serve
The error comes as:
error TS2307: Cannot find module ‘jquery’, and the error looks like below:

The same error sometimes, you will get after adding the web part to a modern SharePoint page like the one below:
[SPLoaderError.loadComponentError]: Failed to load component “”. Original error. Failed to load entry point from component. Error loading… Cannot find module ‘jquery’

cannot find module ‘jquery’ or its corresponding type declarations
The error will come if jQuery is not installed in SPFx solutions. Run the below command to install jQuery in the SPFx solution.
npm install jquery --save

If the solution did not work, then you can try to install the exact version of jQuery by running the below command:
npm uninstall @types/jquery
npm install @types/jquery@3.5.1 --save
Also, you can refer to the jQuery from the CDN. Open the config/config.json file and then add the below code:
"externals":{
"jquery": "https://code.jquery.com/jquery-3.1.0.min.js"
},
Ideally, if you want to use jQuery in SPFx web parts, then you should install the type declarations for jQuery.
npm install --save-dev @types/jquery
This way, you can fix the error: cannot find module ‘jquery’ or its corresponding type declarations
You may also like the following tutorials:
- Typescript split string multiple separators
- ReferenceError fetch is not defined in Typescript
- Typescript replace all occurrences in string
- Typescript Get Last Element of Array

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.