AYUSH CHAUDHARY
AYUSH CHAUDHARY

Reputation: 55

How to upgrade SPFX solution node version from node version 10 to version 14

I have a SharePoint framework solution that builds using node version 10 however I want to upgrade the package node version 10 to 14 if I need to create a new same package or we have some command using that we can use or upgrade node 14.

Upvotes: 1

Views: 842

Answers (1)

Utsav Patel
Utsav Patel

Reputation: 71

https://learn.microsoft.com/en-us/sharepoint/dev/spfx/compatibility

delete node modules then update below in package json

@microsoft/rush-stack-compiler-3.9,
[email protected],
@microsoft/[email protected],
@microsoft/[email protected],
@microsoft/[email protected] --save 

then

npm install

then update tsconfig

"extends": "./node_modules/@microsoft/rush-stack-compiler-3.3/includes/tsconfig-web.json"

to

"extends": "./node_modules/@microsoft/rush-stack-compiler-3.9/includes/tsconfig-web.json"

add below in gulp.js before build.initialize

var getTasks = build.rig.getTasks;
    
build.rig.getTasks = function () {
   var result = getTasks.call(build.rig);
   result.set('serve',result.get('serve-deprecated')); 
  return result;
};

Upvotes: 0

Related Questions