An NPM Package Naming Rule

Bairui Su
2 min readJun 3, 2024

--

Just as every driver dreams of building a car, every front-end engineer dreams of creating their own JavaScript UI framework. As a result, I wrote a JavaScript UI framework called ecojs at first. But I encountered an unexpected error when I wanted to publish it to NPM:

error output

This error ocurred because a package named eco.js already exists, preventing me from publish a package named ecojs to NPM. I also tried eco-js and failed.

Later I found that this is a guideline for NPM packages: publishing a new package whose name is similar to existing packages is not allowed. This helps avoid confusion and potential issues with infringement due to packages having very similar names.

Lesson of the day: when you try to push a new NPM package, make sure there are no similar names instead of merely checking for an exact match.

At last, I solved the issue by changing the package’s name to echox. Check it out here!

--

--

Bairui Su
0 Followers

Creative generation toolmaker. Today's tool help shape tomorrow’s art. Creator Charming.js. Author @antv/g2@5.x