{"action":"closed","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/2030","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/2030/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/2030/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/2030/events","html_url":"https://github.com/ant-design/ant-design/issues/2030","id":160086012,"number":2030,"title":"npm 2 中使用 antd 可能会遇到的问题","user":{"login":"pigcan","id":848515,"avatar_url":"https://avatars.githubusercontent.com/u/848515?v=3","gravatar_id":"","url":"https://api.github.com/users/pigcan","html_url":"https://github.com/pigcan","followers_url":"https://api.github.com/users/pigcan/followers","following_url":"https://api.github.com/users/pigcan/following{/other_user}","gists_url":"https://api.github.com/users/pigcan/gists{/gist_id}","starred_url":"https://api.github.com/users/pigcan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pigcan/subscriptions","organizations_url":"https://api.github.com/users/pigcan/orgs","repos_url":"https://api.github.com/users/pigcan/repos","events_url":"https://api.github.com/users/pigcan/events{/privacy}","received_events_url":"https://api.github.com/users/pigcan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ant-design/ant-design/labels/Usage","name":"Usage","color":"cc317c"}],"state":"closed","locked":false,"assignee":{"login":"superRaytin","id":2723376,"avatar_url":"https://avatars.githubusercontent.com/u/2723376?v=3","gravatar_id":"","url":"https://api.github.com/users/superRaytin","html_url":"https://github.com/superRaytin","followers_url":"https://api.github.com/users/superRaytin/followers","following_url":"https://api.github.com/users/superRaytin/following{/other_user}","gists_url":"https://api.github.com/users/superRaytin/gists{/gist_id}","starred_url":"https://api.github.com/users/superRaytin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superRaytin/subscriptions","organizations_url":"https://api.github.com/users/superRaytin/orgs","repos_url":"https://api.github.com/users/superRaytin/repos","events_url":"https://api.github.com/users/superRaytin/events{/privacy}","received_events_url":"https://api.github.com/users/superRaytin/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2016-06-14T02:44:47Z","updated_at":"2016-06-14T06:40:51Z","closed_at":"2016-06-14T06:40:51Z","body":"### 场景\r\n\r\n项目自身因为需要兼容 IE8 引用了 React 0.14.x 的版本，但是又引用了 antd 大于 1 的版本\r\n\r\n在这种场景下，在 npm2 中会有很多奇怪的报错，报错不出现在构建环境，而是页面访问时候。\r\n\r\n### npm2 中\r\n\r\n项目自身有依赖 `react 0.14.x`, 而 `antd^1.1.0` 的 devDependencies 存在 react 0.15.0，在 2 的环境下 install 完之后 react 0.15.0 会在 antd 的 node_moduels，最终项目在构建的时候项目内会打包进两个 react 版本。进而引发报错。\r\n\r\n### npm3 中\r\n\r\n在如上场景中，install 完之后 react 0.15.0 并不会出现在项目的 node_modules 中，所以构建出来之后只有一个 react 符合预期。\r\n\r\n\r\n### 大致原因\r\n\r\n不同 npm 版本 对于 devDependencies 的处理不同 。\r\n\r\n\r\n### 结论\r\n\r\n还是不要推荐使用 npm2，也不要再考虑 npm2 了吧 - -！"}}
{"actor":{"display_login":"afc163"}}