I'm new to Wordpress development and npm. My goal is to get started creating and editing a website on my computer locally. I followed the "Get Started with Gutenberg in Wordpress" guide from Professor K Explains, which in turn follows the "@wordpress/env" and (mostly) "@wordpress/create-block" guides on Wordpress.org.
This essentially involved installing dependencies: Node.js, Docker, and Git (which I already have), making sure Docker is running (running systemctl start docker if not), followed by npx @wordpress/create-block new-example-block and some other commands following it (which I do not believe are relevant to this issue). On my first attempt, I created a block that runs a local instance of a website successfully.
However, I want a different title for the block, so I tried to create a new one. When I try this again however, running npx @wordpress/create-block new-example-block and npx @wordpress/create-block@latest new-example-block-2 both fail, resulting in a whole host of errors and warnings. (npx @wordpress/create-block@latest is what is currently listed on "@wordpress/create-block", so this line from the article is probably more updated than the one from the video. It still fails, however.)
Warning: Failed to install dependencies:
Command failed with exit code 1: npm install
npm notice Access token expired or revoked. Please try logging in again.
...
[long list of warnings related to dependencies, such as "Could not resolve dependency"]
...
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/@wordpress%2fvips - Not found
npm error 404
npm error 404 The requested resource '@wordpress/vips@^1.0.0-prerelease' could not be found or you do not have permission to access it.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.
...
[also more warnings and errors]
Let me know if you need the whole thing. It's so long I wasn't sure how I should include it.
Most of what I found online was related to the access tokens, though none to Wordpress's create-block process specifically.
Various websites suggested creating a new npm account with npm adduser followed by npm login, but that did not solve the issue. I don't exactly know how it would, as I don't know what access token I was supposed to have, given I did not need to make an account or log in when npx ran successfully the first time.
Other websites suggested moving/removing the .npmrc file in my home/[user] directory. That also failed to do anything.
Lastly, this DevErrors article suggested to follow up the removal of .npmrc by clearing the cache and reinstalling, as below.
npm cache clean --force
rm -rf node_modules package-lock.json
npm install
It still seems to generate the same errors.
I don't really understand what the problem is with access tokens, dependencies, or the @wordpress/vips package. How do I go about solving this issue?