cd ../test-folder/ npm link my-package-publish-test
5. 登录并发布
返回 ./package/ 并执行登录,运行
1 2
cd ../package/ npm login
输入一些 npmjs.org的用户名密码等,登录npm账号
1 2 3 4 5 6
$ npm login Username: ys558 Password: Email: (this IS public) Email: (this IS public) [email protected] Logged in as ys558 on https://registry.npmjs.org/.
!!如出现以下报错需要登录自己的邮箱是否通过 npmjs.org 的验证邮件
1 2 3 4 5 6 7
npm ERR! code E403 npm ERR! 403 403 Forbidden - PUT http://registry.npmjs.org/my-package-publish-test - Forbidden npm ERR! 403 In most cases, you or one of your dependencies are requesting npm ERR! 403 a package version that is forbidden by your security policy.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\yuyi\AppData\Roaming\npm-cache\_logs\2021-07-04T12_02_21_879Z-debug.log
$ npm login scope=zyzy-org Username: zyzy-org Password: Email: (this IS public) [email protected] Logged in as zyzy-org on https://registry.npmjs.org/.