类型错误:无法解构“未定义"或“空"的属性“stat" [英] TypeError: Cannot destructure property `stat` of 'undefined' or 'null'

查看:81
本文介绍了类型错误:无法解构“未定义"或“空"的属性“stat"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 mac 上运行 npm install -g react-native 项目时遇到 TypeError.

I am getting a TypeError when running npm install -g react-native project on mac.

完全错误

TypeError: 无法解构 'undefined' 或 'null' 的属性 stat.在对象.(/usr/local/lib/node_modules/npm/node_modules/@npmcli/node-gyp/lib/index.js:2:29)

TypeError: Cannot destructure property stat of 'undefined' or 'null'. at Object. (/usr/local/lib/node_modules/npm/node_modules/@npmcli/node-gyp/lib/index.js:2:29)

推荐答案

可能你正在使用 npm@latest.在我看来,lates NPM 存在一些问题,我在我的 docker 文件中使用 RUN npm install npm@6.14.11 -g 更改了我的版本.

Might be you are using npm@latest. Looks to me some issue with lates NPM, I have changed my version with RUN npm install npm@6.14.11 -g in my docker file working for me.

这篇关于类型错误:无法解构“未定义"或“空"的属性“stat"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆