npm publish failure may cause record

When npm publish personal bag, I encountered many pits, summarized as follows (may be incomplete):

  1, npm version is too low, processing: npm install -g npm update

  2, possible reasons for rights, treatment: npm publish --access = public

  3, npm source is wrong, deal with: the SET config npm Registry HTTPS: //registry.npmjs.org/ -    Some individuals may not have released unofficial sources, such as Taobao mirroring requires admin privileges

  4, folder name and package.json in the 'name' attribute can not be the same as distributing, processing: the folder name or 'name' inconsistency can be changed

  5, if you have deleted the market with the same name npm package before re-launch a certain time limit ban (currently 24 hours later)

  6, remember to check whether the account login

 

Other commands makeup:

  1, npm init: initialization packet, generates package.json, which points to the inside of the main properties configuration file entry

 

  2, npm publish: publish individual projects to npm

    a: When first released, you need to create a user: npm adduser

    b: regular user login: npm login

 

  3, npm unpublish <pkg> @xyz - delete a version / npm unpublish xxxpackage - (! Caution) to delete the entire version

     npm unpublish recommended replacement command: NPM deprecate the <PKG> [@ Version] <Message>

     Using this command, you do not withdraw existing packages in the community, but when anyone attempting to install this package, you will get warning

   [Note] authority aspects of the report if an error, add parameters: --force

 

Guess you like

Origin www.cnblogs.com/xtreme/p/11769586.html