0

I'm trying to take the plunge into getting SP Framework set up so that I can add the modern script editor (frustrating that it isn't an easy process to set up). I've followed numerous tutorials, but always get held up when trying to do the installations in the command prompt. Each time I try "npm install", I get a list of errors that I don't understand. I've downloaded the 16.15.0 LTS for NodeJS, and I've downloaded the modern script editor web part zip file:

enter image description here

But when I do the NPM Install on command prompt, this is what I get:

enter image description here

I don't know how to proceed with fixing this so that I can add some custom script to my Communication Site page. I'm probably missing something simple, just not sure what.

Any help would be great. Thanks!

1 Answer 1

0

It looks like your command prompt is not in the location where the SPFx project is. As you can see by the error reported, npm is looking for a file called package.json in the same folder where the npm install command is being run.

According to your screenshot, it looks like your command prompt is open in

C:\Users\chsh7966

That zip file looks like it's in your Documents folder, so that would be

C:\Users\chsh7966\Documents

(assuming that chsh7966 is your user account).

In addition, you will need to unzip that zip file. Look inside until you find the package.json file, then open a command prompt in that folder.

Considering that in Windows, expanding zip files tends to duplicate the folder, that may end up being

C:\Users\chsh7966\Documents\sp-dev-fx-webparts-main\sp-dev-fx-webparts-main

Regardless of what the actual path ends up being, though, the important part is that your command prompt needs to be open to the path of where the package.json file is. Once you're there, then run npm install.

1
  • Perfect. Thank you so much. I was able to deploy the web part after fixing the path.
    – Quilly
    Commented May 18, 2022 at 18:55

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.