Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial - Installing Node.js and npm for local WordPress development #1639

Closed
15 tasks done
jonathanbossenger opened this issue Jun 20, 2023 · 12 comments
Closed
15 tasks done
Assignees
Labels
Priority - Medium Medium priority issue.

Comments

@jonathanbossenger
Copy link
Collaborator

jonathanbossenger commented Jun 20, 2023

Topic Description

Node.js is a cross-platform, open-source server environment that can run on most popular operating systems. Node.js lets developers use JavaScript to write command line tools and for server-side scripting. When you install Node.js on your operating system, it comes preinstalled with npm, a command line tool that allows developers to share and use software packages as dependencies in their own projects.

While not specifically a requirement for WordPress development, if you want to develop blocks, contribute to Gutenberg, or use modern tools like wp-env or wp-now, you will need to have Node.js and npm installed on your computer.

In this tutorial, you will learn how to install Node.js and npm on macOS, Ubuntu, and Windows.

Related Resources

Links to related content on Learn, HelpHub, DevHub, GitHub Gutenberg Issues, DevNotes, etc.

Guidelines

Review the team guidelines

Tutorial Development Checklist

  • Vetted by instructional designers for content idea
  • Provide feedback of the idea
  • Gather links to Support and Developer Docs
  • Review any related material on Learn
  • Define several SEO keywords to use in the article and where they should be prominently used
  • Description and Objectives finalized
  • Tutorial created and announced to the team for Q/A review
  • Tutorial reviewed and ready to publish
  • Tutorial submitted and published to WPTV
  • Tutorial published on WPTV
  • Tutorial captioned
  • Tutorial created on Learn.WordPress.org
  • Tutorial post reviewed for grammar, spelling, etc.
  • Tutorial published on Learn.WordPress.org
  • Tutorial announced to Marketing Team for promotion
@jonathanbossenger jonathanbossenger added [Content Type] Tutorial Awaiting Triage Issues awaiting triage. See Training Team handbook for how to triage issues. labels Jun 20, 2023
@jonathanbossenger jonathanbossenger self-assigned this Jun 20, 2023
@jonathanbossenger
Copy link
Collaborator Author

@jonathanbossenger jonathanbossenger added [Audience] Developers Priority - Medium Medium priority issue. and removed Awaiting Triage Issues awaiting triage. See Training Team handbook for how to triage issues. labels Jun 26, 2023
@courtneyr-dev
Copy link
Collaborator

Love that this is happening. I remember my early days getting stuck figuring out what to do to get set up.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2023

This content is ready to be reviewed. Please follow the steps listed under Guidelines for reviewing content. Thank you for your contribution! ✨

@jonathanbossenger
Copy link
Collaborator Author

Tutorial video for review:

installing-nodejs-npm.mp4

@digitalchild
Copy link
Contributor

Great, easy to follow tutorial @jonathanbossenger. I would maybe suggest brew in there as well? As that is available across windows, mac and Linux to install nvm and manage updates to nvm as well.

@jonathanbossenger
Copy link
Collaborator Author

@digitalchild thanks for the review.

As that is available across windows, mac and Linux to install nvm and manage updates to nvm as well.

For Windows, do you mean via WSL? I don't see any other way to install homebrew on Windows.

While I agree that installing homebrew on Mac certainly makes things easier on a mac, I'm trying to limit the amount of things that need to be installed, especially for someone new to the terminal. Hence going with the one copy/paste command to install nvm on mac and Linux, and one copy/paste to install choco, and then one choco install command on Windows.

Those that already have homebrew installed can probably manage all this without needing this beginner tutorial.

@drussell17
Copy link

I had set up a local dev environment for use with trunk a few months ago.
https://make.wordpress.org/core/handbook/tutorials/installing-wordpress-locally/from-svn/
The above page was what I attempted to follow. After struggling with it I contributed the section "For those using Windows 11". AFAIK I didn't use Powershell or a package manager as described in your video. (I do have Powershell installed and NGINX is probably there as well from earlier local web server installs.)
Also please note that at the time of my install V14 of NodeJS was required. So I'm not confident that procedure outlined in your video would work with trunk.

@jonathanbossenger
Copy link
Collaborator Author

@drussell17 thanks for the feedback

So I'm not confident that procedure outlined in your video would work with trunk.

That's the reason I recommend installing nvm, so that one can then install and use node version 14 if one needs to set up WordPress trunk for any reason.

It's also worth noting that the core team are working on updating the requirements to Node.js to 18 and npm to 9.

@digitalchild
Copy link
Contributor

Hi @jonathanbossenger

Thanks for the response, that makes total sense. Are there any tutorials on using WSL, or maybe you could add some links in the tutorial resources? To WSL & Brew?

@westnz
Copy link
Collaborator

westnz commented Jul 4, 2023

Clearly explained, Jonathan! Learning outcomes are achieved. I like the fact that you have catered for various users.

@jonathanbossenger
Copy link
Collaborator Author

Are there any tutorials on using WSL

Not yet, but I am gathering data as to how valuable this would be.

I'm of the opinion that installing and configuring WSL is a bit more of an "intermediate developer" thing, and at the moment I'm still focusing on the beginner-level content.

@jonathanbossenger
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority - Medium Medium priority issue.
Projects
Status: 📜 Published or Closed
Development

No branches or pull requests

5 participants