# NPM 报错集锦

作者：Jiǎ hīm

栏目：文章

发布时间：2025-02-04T00:00:00+08:00

更新时间：2026-12-03T08:50:26.928Z

正式引用地址：https://jiahim.com/articles/legacy-skill-npm/

分类：技术文章

摘要：npm ERR\! Cannot read properties of null \(reading 'isDescendantOf'\)要安装新的 npm 包，发现一直报这个错，不是网络问题删除项目下的 node_modules 目录，重新执行 npm instal，然后再安装想要安装的包即可参考：\[BUG\] Runnin

---

## npm ERR\! Cannot read properties of null \(reading 'isDescendantOf'\)

要安装新的 npm 包，发现一直报这个错，不是网络问题

~~~shell
npm ERR! Cannot read properties of null (reading 'isDescendantOf')
~~~

删除项目下的 `node_modules` 目录，重新执行 `npm instal`，然后再安装想要安装的包即可

> 参考：[\[BUG\] Running npm i fails with Cannot read properties of null \(reading 'isDescendantOf'\) \#5687](<https://github.com/npm/cli/issues/5687>)
