0

Sample:(PS: You can find what I tested in the GitHub link below)

https://github.com/pnp/sp-dev-fx-webparts/blob/master/samples/react-mgtEvents/src/webparts/mgtEvents/MgtEventsWebPart.ts

Problem: Hello,

I would like to add the react-mgtEvents web part to my SharePoint Online site. I installed the node-js version from the below URL:https://nodejs.org/download/release/v10.24.1/

After that, I tried to execute the npm install command on the react-mgtEvents folder path. However, I am getting the below errors after it finishes: What are the dependencies that should be installed for this solution to make it run successfully and upload the app to the SharePoint app catalog? Can please someone provide the steps needed?

Any help is highly appreciated.

Thank you!

enter image description here enter image description here

3
  • Some dependencies builds on your pc after them downloaded, so, did you see this link? stackoverflow.com/questions/34372618/…
    – Maxim
    Dec 21, 2021 at 4:37
  • i have tried all the commands listed in the link above by you and i tried to many node versions including its proper npm: node: 16.x, 13.x,12.x,10.x but whenever i use the node 10.x version an error prompt pops-up saying that nmp doesn't support lower node version When i use the other versions of node the errors in the pictures above pops-up My main target is to make ' nmp install ' command work in order to continue with my next commands I don't know if the problem is form node version or npm version or from the packages Dec 21, 2021 at 12:05
  • @Maxim Could you please try to install it on your end and provide the steps needed with the packages installation needed to make sure it is working? I look forward to your response. Dec 21, 2021 at 12:22

1 Answer 1

1

So, I checked this solution in my environment and I got the same error. The error occurs due to the fact that some old packages are compiled immediately after downloading. In new versions of NPM, this was abandoned, so an error appears.

In my case this is expected. I have:

node -v
v14.16.1

npm list -g --depth=0
+-- @microsoft/[email protected]
+-- [email protected]
`-- [email protected]

Because I build spfx webparts by latest spfx version. So, you can install microsoft 365 cli:

npm i @pnp/cli-microsoft365 -g

and then upgrade solution to [email protected]:

m365 spfx project upgrade

this command show you steps for upgrading spfx solution, after you do them your project will be successfully builds (don't forget to install [email protected] in project)

Second solution:

  • downgrade to node 10.x
  • prepare environment to work with [email protected] (or early)
  • install old version python2.7 to folder c:\python27
  • install node-gyp

Bud this solution you should provide only if you build spfx solutions to on premises farm.

spfx version compatibility spfx prepare environment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.