Upload custom third-party modules

@ Third-party modules

Thoughts: We are not able to package their own custom modules into third-party modules?

analysis:

Third-party modules have the characteristics:

 					1. 有一定的功能
             		2. 存储在: http://www.npmjs.com 中

Solution: Upload custom module ( http://www.npmjs.com )

  1. Create a file package.json

    $ npm init -y
    
  2. Register an account on this site http://www.npmjs.com

    Note: the first landing will send a message to your mailbox (this is sent manually), then activate the landing-mail

  3. Check your source computer is not the source npm

    $ nrm ls
    

    If so, it will not bother

    If not, then switch to source $ nrm use npm npm cut source

  4. Command line login npmjs warehouse

    $ npm adduser
    
  5. Create a module and export module

  6. See if your name is already in use package

  7. Release package

   $ npm publish

8. Add custom npm operation command packet:

                 1. npm unpublish  **[email protected]** //取消发布指定版本号,具体见打包工具
                 2. npm  whoami    //查看当前登录用户名

Students make mistakes point: **

1. 邮箱没有激活 ( 最多的 )
2. npm源没有切换
3. 整个电脑的npm就不能使用

Guess you like

Origin blog.csdn.net/HelloWord182/article/details/93205113