# npm install 因 package.json 配置错误而失败

**URL:** <https://meta.discourse.org/t/npm-install-fails-due-to-package-json-misconfiguration/101193>\
**Category:** Development\
**Created:** [2018 年11 月 3 日 09:31 UTC](https://meta.discourse.org/t/npm-install-fails-due-to-package-json-misconfiguration/101193 "2018-11-03T09:31:37Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

作者： ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)\
发布日期： [2018 年11 月 5 日 20:30 UTC](https://meta.discourse.org/t/npm-install-fails-due-to-package-json-misconfiguration/101193/12 "2018-11-05T20:30:01Z")

</div>

This commit adds a preinstall hook that stops `npm install` and outputs “NPM is not supported, please use Yarn instead.” to the user.  
[https://github.com/discourse/discourse/commit/0fdb4d0e46e8a9f0bfae9368546c99b8030b5d48](https://github.com/discourse/discourse/commit/0fdb4d0e46e8a9f0bfae9368546c99b8030b5d48)

---

_[View the full topic](https://meta.discourse.org/t/npm-install-fails-due-to-package-json-misconfiguration/101193)._
