{"action":"opened","issue":{"url":"https://api.github.com/repos/Myoursky/Blog/issues/36","repository_url":"https://api.github.com/repos/Myoursky/Blog","labels_url":"https://api.github.com/repos/Myoursky/Blog/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/Myoursky/Blog/issues/36/comments","events_url":"https://api.github.com/repos/Myoursky/Blog/issues/36/events","html_url":"https://github.com/Myoursky/Blog/issues/36","id":348613380,"node_id":"MDU6SXNzdWUzNDg2MTMzODA=","number":36,"title":"npm publish","user":{"login":"Myoursky","id":4679709,"node_id":"MDQ6VXNlcjQ2Nzk3MDk=","avatar_url":"https://avatars3.githubusercontent.com/u/4679709?v=4","gravatar_id":"","url":"https://api.github.com/users/Myoursky","html_url":"https://github.com/Myoursky","followers_url":"https://api.github.com/users/Myoursky/followers","following_url":"https://api.github.com/users/Myoursky/following{/other_user}","gists_url":"https://api.github.com/users/Myoursky/gists{/gist_id}","starred_url":"https://api.github.com/users/Myoursky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Myoursky/subscriptions","organizations_url":"https://api.github.com/users/Myoursky/orgs","repos_url":"https://api.github.com/users/Myoursky/repos","events_url":"https://api.github.com/users/Myoursky/events{/privacy}","received_events_url":"https://api.github.com/users/Myoursky/received_events","type":"User","site_admin":false},"labels":[{"id":757801537,"node_id":"MDU6TGFiZWw3NTc4MDE1Mzc=","url":"https://api.github.com/repos/Myoursky/Blog/labels/tools","name":"tools","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-08T07:50:26Z","updated_at":"2018-08-08T07:50:26Z","closed_at":null,"author_association":"OWNER","body":"# npm publish(npm发布项目)\r\n\r\n## package.json简单分析\r\n\r\n```\r\n{\r\n  \"name\": \"myoursky-npm-pkg\",\r\n  \"version\": \"1.0.0\",\r\n  \"description\": \"\",\r\n  \"main\": \"index.js\",\r\n  \"scripts\": {\r\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\r\n  },\r\n  \"keywords\": [],\r\n  \"author\": \"\",\r\n  \"license\": \"ISC\"\r\n}\r\n```\r\nname: 发布的项目名称\r\n\r\nversion: 发布的版本\r\n\r\n**注意: 每次更新代码并发布时需要更新发布版本。此处有一个原则需要遵守。**\r\n\r\n![semvertable](https://user-images.githubusercontent.com/4679709/43823704-878eed18-9b22-11e8-8f72-e0fa9b65cf0b.png)\r\n\r\nmain: 入口文件\r\n\r\n## 发布\r\n\r\n### 创建账户\r\n\r\n### npm adduser\r\n此处如果设置了淘宝npm镜像，需要先切回原来的registry。\r\nhttps://registry.npmjs.org/,不然会默认将user加到淘宝镜像上,\r\n加完之后再切回淘宝镜像。此时为了让项目正常发布，需要在package.json中添加如下配置\r\n```\r\n\"publishConfig\": {\r\n  \"registry\": \"https://registry.npmjs.org/\"\r\n}\r\n```\r\n\r\n### npm publish\r\n发布成功！"}}
{"actor":{"display_login":"Myoursky"}}