![]() In my case, it’s: cd development/websites/wordpress/wp-content/plugins In your terminal change the directory to the WP content plugins directory of your local WordPress installation. Now you’re ready to use the create-block tool to create your first block. Once nvm is installed, use the nvm install command to install the required Node.js and npm versions nvm install 14įinally, run the nvm use command to use the version of Node js and npm you just installed. Once Chocolatey is installed, use the following command to install nvm: choco install -y nvm Copy the instructions and right-click in the PowerShell window to paste them. Then browse to the Chocolatey setup documentation and scroll down to the Install with PowerShell instructions. First open PowerShell with administrative privileges by right-clicking on the PowerShell menu item and selecting Run as Administrator. If you’re on a Windows machine, you will need to install the Chocolatey package manager for Windows to install nvm. Then you can use the nvm install command to install the Node.js and npm versions you need. Once npm is installed, you need to close your terminal and reopen it. If you’re running macOS, or Linux, you can open your default terminal application and install nvm by running the npm install script which you copy from the nvm documentation. For the purposes of this tutorial, we’ll install the same version needed for core Block Development, which is listed in the Block Editor handbook on the Getting Started development environment page.Ĭurrently, it’s recommended to install Node.js version 14. The great thing about using nvm is if your version requirements change, it’s very easy to update your Node.js version using nvm. To find this, you can go to nvm.sh which will direct you to the GitHub page. Fortunately, you can do this using the open source node version manager, also known as nvm. ![]() However, depending on your development requirements, you might need to be able to switch Node.js versions quickly between projects. ![]() The create-block tool will work with any stable version of Node.js greater than version 12. For Windows users, we recommend installing and using PowerShell which you can find by going to /powershell.įinally, you need to install Node.js, which also installs npm. If you’re running Mac OS or any Linux operating system, you can use the built-in terminal. If you don’t already have a local WordPress install, please take a look at the Local WordPress Installations for Beginners tutorial at. You can use any local WordPress install you’re comfortable with, like LocalWP or DesktopServer. You can read more about create-block by visiting the Block Editor handbook in the WordPress developer resources page under Reference Guides -> Packages -> order to use the create-block tool, you’re going to need a local WordPress install, a terminal to run commands, and Node.js and npm. It generates everything you need to start a new blog plugin and integrates a modern built setup with no configuration. In this video, we will cover what the create-block tool is, what software you need to use create-block, how to scaffold a new block using create-block, and the code generated by create-block.Ĭreate-block is an official command line tool developed by WordPress contributors to scaffold or create a new block plugin. In this tutorial, you’re going to learn how to use the create-block tool to scaffold a new block plugin. Hey there, and welcome to Learn WordPress.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |