- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我只是想试试 react-native。但是我得到这个错误。 Metro 遇到错误:无法读取未定义的属性“transformFile”。我在我的物理设备和模拟器上试过了,错误是一样的。我在我的控制台中收到此消息“无法构建转换器:错误:Node Sass 尚不支持您当前的环境:Windows 64 位且运行时不受支持 (88)”
这是我的 package.json 文件
{
"name": "XYZ",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "prettier --write src/**/*.{ts,tsx} && eslint src/**/*.{ts,tsx}"
},
"husky": {
"hooks": {
"pre-commit": "yarn lint && yarn test"
}
},
"dependencies": {
"@apollo/react-hooks": "^3.1.5",
"@react-native-community/async-storage": "^1.12.0",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/netinfo": "^5.9.6",
"@react-navigation/drawer": "^5.9.0",
"@react-navigation/native": "^5.7.3",
"@react-navigation/stack": "^5.9.0",
"@types/react-native-auth0": "^2.5.0",
"apollo-boost": "^0.4.9",
"babel": "^6.23.0",
"babel-core": "^6.26.3",
"babel-upgrade": "^1.0.1",
"date-fns": "^2.16.1",
"metro-config": "^0.59.0",
"react": "^16.13.1",
"react-native": "^0.62.2",
"react-native-auth0": "^2.5.0",
"react-native-dotenv": "^0.2.0",
"react-native-elements": "^2.2.1",
"react-native-gesture-handler": "^1.8.0",
"react-native-google-places-autocomplete": "^1.8.0",
"react-native-linear-gradient": "^2.5.6",
"react-native-reanimated": "^1.13.0",
"react-native-safe-area-context": "^1.0.0",
"react-native-screens": "^2.10.1",
"react-native-skeleton-placeholder": "^2.0.7",
"react-native-step-indicator": "^1.0.3",
"react-native-svg": "^12.1.0",
"react-native-swiper": "^1.6.0",
"react-native-tab-view": "^2.15.1",
"react-native-vector-icons": "^7.0.0",
"reanimated-bottom-sheet": "^1.0.0-alpha.20"
},
"devDependencies": {
"@babel/core": "^7.11.1",
"@babel/runtime": "^7.11.2",
"@react-native-community/eslint-config": "^1.0.0",
"@types/jest": "^24.0.24",
"@types/react-native": "^0.62.0",
"@types/react-native-dotenv": "^0.2.0",
"@types/react-test-renderer": "^16.9.3",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.27.0",
"babel-jest": "^24.9.0",
"eslint": "^7.7.0",
"eslint-config-airbnb-typescript": "^7.2.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.0",
"husky": "^4.2.5",
"jest": "^26.4.0",
"metro-react-native-babel-preset": "^0.58.0",
"node-sass": "^4.14.1",
"prettier": "^2.0.5",
"react-native-sass-transformer": "^1.4.0",
"react-native-svg-transformer": "^0.14.3",
"react-test-renderer": "^16.13.1",
"ts-jest": "^26.2.0",
"typescript": "^3.9.7"
}
}
最佳答案
我卸载了最新版本的 node 并安装了 node 的 LTS(长期支持),它开始工作了
关于reactjs - Metro 遇到错误 "Cannot read property "transformFile"of undefined react native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66577009/
我已更新 node今天,我收到此错误: error: TypeError: Cannot read properties of undefined (reading 'transformFile')
我想写一个 babel 插件,我的插件中有一个 transfromFileSync 调用。我需要获取 transformFileSync 的选项。怎么做? // run transformFile v
将我的项目更新到 expo SDK 43 后,我遇到了一个问题我尝试了不同的 LTS 节点版本(14.8.1、16.1.3 和 17.0.1),但问题没有解决。我的同事在带有 intel 芯片组的 m
我只是想试试 react-native。但是我得到这个错误。 Metro 遇到错误:无法读取未定义的属性“transformFile”。我在我的物理设备和模拟器上试过了,错误是一样的。我在我的控制台中
每当我运行react-native start时,我都会收到此错误,但是最近在我在节点模块中安装了firebase-tools和stripe之后,这种情况开始发生,但在此之前它会运行得很好,这也是错误
我是一名优秀的程序员,十分优秀!