I am starting to read and learn about SharePoint Framework (SPFx).

My development environment is a VM on a machine that does not have access to the internet.

How would I go collect all the dependencies using Yarn on my laptop, and then moving them to the VM? (I can install Node.js and Yarn using their installers on the VM.)

Which yarn commands would I use to save the dependencies offline?


You can copy /node_modules from the root folder of your SPFx project from your laptop to the VM.

| improve this answer | |

I actually end up using the yarn-offline-mirror method.

  1. First installed NodeJS and Yarn on a computer with internet. Then setup the yarn-offline-mirror folder to collect all the dependencies.

  2. Then added Yeoman and Gulp, and the SP Generator. All the dependency .tgz files are stored in yarn-offline-mirror.

  3. I installed NodeJS and Yarn on the VM with the installers.

  4. With the help of this blog about working with Yarn offline, I copied the files yarn.lock, package.json and the ~/yarn-offline-mirror/ folder to the VM without internet and added the dependencies while adding --offline to the add commands.

  5. Finally installed Yeoman SharePoint generator with yo @microsoft/sharepoint --package-manager yarn --offline.

and Done!

...however, as I mentioned at the start I'm just starting with SPFx, I need to continue playing around and check if another other errors come up.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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