【NPM】npm-related

You must use npm mirroring, not Taobao mirroring

view current mirror

npm config get registry

Switch the mirror to npm (Taobao mirror cannot be used)

npm config set registry https://registry.npmjs.org

Execute in the package file directory to be published

  • publish as public package
npm publish --access public 
  • Packages published as default
npm publish  

The uploaded package cannot be downloaded to the latest version

  • Description of the problem: After the module is released to npm, because it is released to the official image of npm, and most of the installation is installed from the image of Taobao, there will be an inconsistency between the version of the official image and the image of Taobao . If there is a gap between the release of npm and the installation module The time is very short, it is likely that an old version is installed or this module cannot be found.
  • Solve the problem:
    go to the Taobao mirror address (https://npmmirror.com), enter the module name just uploaded to query.
    If you can find that the version number of the cnpm module corresponds to npm , there is no problem, otherwise click SYNC to synchronize the latest module version.
    insert image description here

Or switch the official npm source download module

npm config set registry https://registry.npmjs.org

npm delete published version

  • npm unpublish 包名@x.x.x --force

Example to delete the colorspick package of version 1.2.3

npm unpublish [email protected] --force 

End

2023/4/21 6:39 Series


2023/4/21 8:09 changed

Guess you like

Origin blog.csdn.net/qq_43614372/article/details/130279473
NPM