jayli / jayli/jayli.github.com
tensorflow 引用 node 版本的错误解决办法
- Dominant language
- HTML
- Stars
- 664
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
tensorflow 引用 node 版本的错误
node-pre-gyp info This Node instance does not support builds for N-API version 4
node-pre-gyp info This Node instance does not support builds for N-API version 5
node-pre-gyp info This Node instance does not support builds for N-API version 6
node-pre-gyp info This Node instance does not support builds for N-API version 4
node-pre-gyp info This Node instance does not support builds for N-API version 5
node-pre-gyp info This Node instance does not support builds for N-API version 6
/Users/bachi/gitlab/ding-server/node_modules/_@tensorflow_tfjs-node@2.7.0@@tensorflow/tfjs-node/dist/index.js:49
throw new Error("The Node.js native addon module (tfjs_binding.node) can not " +
^
Error: The Node.js native addon module (tfjs_binding.node) can not be found at path: /Users/bachi/gitlab/ding-server/node_modules/_@tensorflow_tfjs-node@2.7.0@@tensorflow/tfjs-node/lib/napi-v3/tfjs_binding.node.
Please run command 'npm rebuild @tensorflow/tfjs-node build-addon-from-source' to rebuild the native addon module.
If you have problem with building the addon module, please check https://github.com/tensorflow/tfjs/blob/master/tfjs-node/WINDOWS_TROUBLESHOOTING.md or file an issue.
at Object. (/Users/bachi/gitlab/ding-server/node_modules/_@tensorflow_tfjs-node@2.7.0@@tensorflow/tfjs-node/dist/index.js:49:11)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/Users/bachi/gitlab/ding-server/brain/brain.js:5:1)
at Module._compile (internal/modules/cjs/loader.js:701:30)
解决办法,
进入问题目录 cd /Users/bachi/gitlab/ding-server/node_modules/_@tensorflow_tfjs-node@2.7.0@@tensorflow/tfjs-node/lib
这里只有 /napi-v5,复制一个目录到 /napi-v3 即可
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the require failure reported from brain/brain.js, then inspect the @tensorflow/tfjs-node lib directory and its available N-API folders. Compare the installed Node.js and TensorFlow.js native-addon versions, and verify whether the reported workaround resolves the missing tfjs_binding.node error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, tensorflow
- Domain
- backend, machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100