DEV Community

noellefajt
noellefajt

Posted on

Installing open-wc on MacOS

Download Node.js (https://nodejs.org/en/) and when the download is done click through the agreements/ permissions. To make sure that it is all installed correctly type the commands node -v and npm -v in the terminal to see if the version numbers are returned.

Yarn (https://yarnpkg.com/)
Since you just installed npm open a new terminal and type npm install –global yarn. Because of permission and access errors on your device you may have to type sudo npm install –global yarn to override this.

Open-wc boilerplate
Create a folder where you want the project to be saved. Open up the terminal and locate the folder with command cd /. Next type npm init @open-wc and select “Scaffold a new project,” “Web Component,” “Linting,” “Testing,” and “Demoing.” Select No for Typescript. Next name it hello-world in all lowercase, then select yes to write the files to your hard drive. Then select yes with yarn. It will display “You’re all set up” in the terminal if it is set up correctly. In order to run it type the command cd hello-world and npm run start.

Top comments (0)