jayli.github.com icon indicating copy to clipboard operation
jayli.github.com copied to clipboard

tensorflow 引用 node 版本的错误解决办法

Open jayli opened this issue 5 years ago • 0 comments

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/_@[email protected]@@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/@[email protected]@@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/@[email protected]@@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/_@[email protected]@@tensorflow/tfjs-node/lib

这里只有 /napi-v5,复制一个目录到 /napi-v3 即可

jayli avatar Nov 20 '20 07:11 jayli