Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS TurboModules迁移 codegen报错 #922

Open
LZQVicLi opened this issue Dec 26, 2024 · 1 comment
Open

iOS TurboModules迁移 codegen报错 #922

LZQVicLi opened this issue Dec 26, 2024 · 1 comment

Comments

@LZQVicLi
Copy link

LZQVicLi commented Dec 26, 2024

参照文档:https://reactnative.cn/docs/0.73/the-new-architecture/pillars-turbomodules
node ./node_modules/react-native/scripts/generate-codegen-artifacts.js \ --path ./ \ --outputPath RTNCalculator/generated/
新 rn 项目已经跑通;
在业务项目中,`
[Codegen] Processing react-native core libraries
[Codegen] Found react-native

[Codegen] >>>>> Searching for codegen-enabled libraries in /Users/username/companyRN/node_modules
[Codegen] Found @react-native-community/slider
[Codegen] Found react-native-gesture-handler
[Codegen] Found react-native-pager-view
[Codegen] Found react-native-safe-area-context
[Codegen] Found react-native-screens
[Codegen] Found rtn-calculator

[Codegen] >>>>> Searching for codegen-enabled libraries in react-native.config.js

[Codegen] >>>>> Searching for codegen-enabled libraries in the app

[Codegen] >>>>> Processing FBReactNativeSpec
node:internal/fs/utils:348
throw err;
^

Error: ENOENT: no such file or directory, lstat '/var/folders/ck/39b1k5cx4j9_rn9r7vx1kvqm0000gn/T/FBReactNativeSpeccuYgxg/schema.json'
at Object.lstatSync (node:fs:1574:3)
at /Users/username/companyRN/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:79:10
at Array.forEach ()
at Object. (/Users/username/companyRN/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:78:10)
at Module._compile (node:internal/modules/cjs/loader:1120:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
at Module.load (node:internal/modules/cjs/loader:998:32)
at Module._load (node:internal/modules/cjs/loader:839:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
errno: -2,
syscall: 'lstat',
code: 'ENOENT',
path: '/var/folders/ck/39b1k5cx4j9_rn9r7vx1kvqm0000gn/T/FBReactNativeSpeccuYgxg/schema.json'
}

Node.js v18.7.0
Error: Command failed: node /Users/username/companyRN/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js --platform ios /var/folders/ck/39b1k5cx4j9_rn9r7vx1kvqm0000gn/T/FBReactNativeSpeccuYgxg/schema.json /Users/username/companyRN/node_modules/react-native/Libraries
node:internal/fs/utils:348
throw err;
^

Error: ENOENT: no such file or directory, lstat '/var/folders/ck/39b1k5cx4j9_rn9r7vx1kvqm0000gn/T/FBReactNativeSpeccuYgxg/schema.json'
at Object.lstatSync (node:fs:1574:3)
at /Users/username/companyRN/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:79:10
at Array.forEach ()
at Object. (/Users/username/companyRN/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:78:10)
at Module._compile (node:internal/modules/cjs/loader:1120:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
at Module.load (node:internal/modules/cjs/loader:998:32)
at Module._load (node:internal/modules/cjs/loader:839:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
errno: -2,
syscall: 'lstat',
code: 'ENOENT',
path: '/var/folders/ck/39b1k5cx4j9_rn9r7vx1kvqm0000gn/T/FBReactNativeSpeccuYgxg/schema.json'
}

Node.js v18.7.0

at checkExecSyncError (node:child_process:851:11)
at execSync (node:child_process:923:15)
at executeNodeScript (/Users/username/companyRN/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:38:3)
at generateSchema (/Users/username/companyRN/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:314:3)
at /Users/username/companyRN/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:373:26
at Array.forEach (<anonymous>)
at generateNativeCodegenFiles (/Users/username/companyRN/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:362:13)
at Object.execute (/Users/username/companyRN/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:532:5)
at Object.<anonymous> (/Users/username/companyRN/node_modules/react-native/scripts/generate-codegen-artifacts.js:64:10) {

status: 1,
signal: null,
output: [
null,
,
<Buffer 6e 6f 64 65 3a 69 6e 74 65 72 6e 61 6c 2f 66 73 2f 75 74 69 6c 73 3a 33 34 38 0a 20 20 20 20 74 68 72 6f 77 20 65 72 72 3b 0a 20 20 20 20 5e 0a 0a 45 ... 1024 more bytes>
],
pid: 71901,
stdout: ,
stderr: <Buffer 6e 6f 64 65 3a 69 6e 74 65 72 6e 61 6c 2f 66 73 2f 75 74 69 6c 73 3a 33 34 38 0a 20 20 20 20 74 68 72 6f 77 20 65 72 72 3b 0a 20 20 20 20 5e 0a 0a 45 ... 1024 more bytes>
}

[Codegen] Done.
`

@LZQVicLi
Copy link
Author

LZQVicLi commented Dec 26, 2024

package.json
{
"name": "companyRN",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
"bundle-ios": "react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ./bundle/ios/main.jsbundle --assets-dest ./bundle/ios",
"bundle-android": "react-native bundle --entry-file index.js --platform android --dev false --bundle-output ./android/company-android/app/src/main/assets/index.android.bundle",
"bundle-android-code-push": "react-native bundle --entry-file index.js --platform android --dev false --bundle-output ./bundle/android/index.android.bundle --assets-dest ./bundle/android",
"prepare": "husky install"
},
"dependencies": {
"@ant-design/icons-react-native": "^2.3.2",
"@ant-design/react-native": "^5.0.4",
"@babel/preset-env": "^7.1.6",
"@react-native-async-storage/async-storage": "^1.18.1",
"@react-native-camera-roll/camera-roll": "^5.2.3",
"@react-native-community/art": "1.2.0",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-community/segmented-control": "^2.2.2",
"@react-native-community/slider": "^4.4.3",
"@react-native-picker/picker": "^2.4.8",
"@react-navigation/material-top-tabs": "^6.6.3",
"@react-navigation/native": "^6.1.3",
"@react-navigation/native-stack": "^6.9.9",
"@types/lodash.isequal": "^4.5.6",
"@types/lodash.throttle": "^4.1.7",
"@types/react-native": "^0.71.3",
"add": "^2.0.6",
"ahooks": "^3.7.6",
"buffer": "^6.0.3",
"crypto-js": "^4.1.1",
"grapheme-splitter": "^1.0.4",
"husky": "^8.0.3",
"company-rn-codepush": "^0.1.1",
"company-rn-dark": "^0.1.4",
"company-rn-debug": "^0.1.0",
"company-rn-demo": "^0.2.3",
"company-rn-network": "^0.0.4",
"company-rn-public": "^0.1.0",
"company-rn-refresh": "^0.1.3",
"company-rn-storage": "^0.1.1",
"company-rn-track": "^0.0.8",
"company-rn-uikit": "^0.0.2",
"lodash.isequal": "^4.5.0",
"lodash.throttle": "^4.1.1",
"prop-type": "^0.0.1",
"prop-types": "^15.8.1",
"react": "18.2.0",
"react-native": "0.71.7",
"react-native-cli": "^2.0.1",
"react-native-code-push": "^8.0.1",
"react-native-gesture-handler": "^2.9.0",
"react-native-intersection-observer": "^0.0.9",
"react-native-pager-view": "^6.2.0",
"react-native-reanimated": "^3.5.4",
"react-native-safe-area": "^0.5.1",
"react-native-safe-area-context": "^4.5.0",
"react-native-screens": "^3.19.0",
"react-native-simple-store": "^2.0.2",
"react-native-swipe-list-view": "^3.2.9",
"react-native-tab-view": "^3.5.2",
"react-native-webview": "^11.26.1",
"react-redux": "^8.0.5",
"redux": "^4.2.1",
"redux-logger": "^3.0.6",
"redux-promise-middleware": "^6.1.3",
"redux-thunk": "^2.4.2",
"rn-intersection-observer": "^0.3.0",
"rtn-calculator": "file:RTNCalculator",
"use-subscription": "^1.8.0",
"yarn": "^1.22.19"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"@types/crypto-js": "^4.1.1",
"@types/jest": "^29.4.0",
"@types/react": "^18.0.28",
"@types/react-test-renderer": "^18.0.0",
"@types/use-subscription": "^1.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.67.0",
"react-native-debugger-open": "^0.3.25",
"react-test-renderer": "18.2.0",
"typescript": "^4.9.5"
},
"jest": {
"preset": "react-native"
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant