Logo

dev-resources.site

for different kinds of informations.

My personal business card - What's next?

Published at
2/6/2020
Categories
npm
package
npx
businesscard
Author
rossanodan
Categories
4 categories in total
npm
open
package
open
npx
open
businesscard
open
Author
10 person written this
rossanodan
open
My personal business card - What's next?

What's next?

Now that the package is up and running, I'd like to change it a bit. I'd like to change the name, for example. Something like npx rossanodan would be far better!

I also noted the README is wrong!!!

How to rename a published npm package

Honestly, I don't have a clue about how to rename a npm package so I searched on Google and I found this https://stackoverflow.com/questions/28371669/renaming-a-published-npm-module

In simple words no you can't. But npm provides you a different solution called npm deprecate.
What it does is it marks a particular version or version ranges of that package as deprecated. So next if someone tries to install this package they get a warning package deprecated along with your custom message, in which you can easily specify your new package name.
Usage
npm deprecate my-package-name@"< latest-version" "your message"
Your message can be any thing like:
WARNING: This project has been renamed to your-new-package-name. Install using new-package-name instead.

So I run

npm deprecate rossanodan-card@"< 1.1.0" "This project has been renamed to rossanodan. Install using npx rossanodan instead."

Alt Text

I want to check the deprecation, so I run

npm uninstall rossanodan-card
npx rossanodan-card
Enter fullscreen mode Exit fullscreen mode

Nothing changed, it works like before.

Unpublish

Things get interesting. Since no one should depends on my package, I dediced to unpublish it.

I export the NPM_TOKEN once again (I didn't save it into my bash_profile)

export NPM_TOKEN=XXXXXXXXXXXXXXXXXX // use your token here
Enter fullscreen mode Exit fullscreen mode

I had an authentication issue.. I need to login again! I run npm adduser and this prompts

Username: YOUR NPM USERNAME
Password: YOUR NPM PASSWORD
Email: (this IS public) YOUR NPM EMAIL

// If everything is correct

Logged in as YOUR USERNAME on https://registry.npmjs.org/.
Enter fullscreen mode Exit fullscreen mode

It's time to unpublish

npm unpublish rossanodan-card --force
Enter fullscreen mode Exit fullscreen mode

The packages section is now empty, hurray!!! Now i can create a new npm package with the new name.

I will reuse the same repository, I don't need creating a new one. It's enough reworking the package.json and editing the information I want to change.

All done

The new package is available at https://www.npmjs.com/package/rossanodan

Alt Text

npx Article's
30 articles in total
Favicon
Improving Port Management Speed: Why I Created `port-client` to Replace `npx kill-port`
Favicon
How to install react
Favicon
npm vs npx: Choosing the Right Tool for the Job
Favicon
npm vs npx - What's the difference?
Favicon
npmใจnpxใฎ้•ใ„
Favicon
Package Manager Fight: npm vs pnpm vs npx vs yarn vs bun
Favicon
App::cpx
Favicon
NPM vs NPX: What's the Difference?
Favicon
npm vs npx โ€” What are the Basic Difference?
Favicon
Create an NPX professional card
Favicon
Diferenรงa entre NPM INIT eย NPX
Favicon
Demystifying NPM and NPX: A Dive into Package Management
Favicon
npm vs npx: Friends or Enemy?
Favicon
Understanding npm vs npx: A Developer's Guide ๐Ÿ“ฆ๐Ÿš€
Favicon
Understanding NPM and NPX in frontend Development
Favicon
A NodeJS newbie's guide to understanding NPM and NPX
Favicon
Errors when creating strapi app using the command npx create-strapi-app@latest --quickstart
Favicon
Npx, c'est quoi ?
Favicon
You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0)
Favicon
What is NPX?
Favicon
Use this NPM script to create your EditorConfig files
Favicon
Creating an npx Command
Favicon
Automatically Remove Unused Node Modules with Python
Favicon
Animated CLI Profile Card
Favicon
Useful Npx Packages for the Developer's Everyday Life
Favicon
Short Video example in 20 Seconds. Get a Github directory quickly by a simple command without installation.
Favicon
My personal business card - What's next?
Favicon
Creating my personal business card
Favicon
When to Use Global NPM Installs? Rarely
Favicon
Useful NPX

Featured ones: