Posts

Showing posts with the label npm commands

Know your SharePoint Framework (SPFx) version

Image
Hi Friends, Most of the time when we are working on the SharePoint Framework or SPFx solutions, the version of each component can create issues while building the solutions. One of the common issues is with the SPFx version. SPFx version is the version of the SharePoint Framework yeomen generator installed on your machine. With the difference in the version, a solution might differ in the import versions of other libraries, change in solution scaffolding, and more... ➡️Steps to know your SPFx version Open the console  Type in the following command  npm ls -g --depth=0 @microsoft/generator-sharepoint Hit enter and wait for a few seconds. You'll get the response   Happy Coding #Microsoft #SharePoint #SharePointWidgets

How to resolve certificate issue in SharePoint Framework Solution

Image
Hi Friends, Today i will be discussing about the certificate issue when we run the gulp command and try to run the SharePoint Framework Solution in local workbench. Issue: Warning - [spfx-serve] When serving in HTTPS mode, a PFX cert path or a cert path and a key path must be provided, or a dev certificate must be generated and trusted. If a SSL certificate isn't provided, a default, self-signed certificate will be used. Expect browser security warnings . If you read the issue , the issue is that it does not find the certificate that shows trust in the URL you are accessing, because of which you see the following message on the screen. Solution: So here is the simple solution and you won’t experience this issue any more. In your solution open the node command prompt. If you are working in Visual code then open the solution and then press the ~ + Cntrl . Now follow the 2 steps: Execute the command gulp trust-dev-cert Click Y...

Update package.json to get latest packages in SharePoint Framework Solution

Image
Hi Friends, We are getting constantly updated packages from Microsoft and it's hard to determine what all packages have been published since you created you SharePoint Framework project. So to deal with this problem we can run the below commands and make this hectic task a much simple one. As we know until the package.json is updated it will not get the latest package no matter how many times you install the packages. So to updates the package.json in the SharePoint Framework solution you just need to run the following commands in your solution npm install -g npm-check-updates : This will install the npm package globally. Installing it globally will allow the package to be used in all the solution without re-installing it npm-check-update -u : Checks and updates all the packages in your package.json and updates them with the lates versions. Note this step only updates the package,json with the latest version of the packages referred in the solution npm install : T...