@ 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 )
-
Create a file package.json
$ npm init -y
-
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
-
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
-
Command line login npmjs warehouse
$ npm adduser
-
Create a module and export module
-
See if your name is already in use package
-
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就不能使用