#node.js #tensorflow #visual-studio-code #tensorflow.js
Вопрос:
Я использую версию узла v10.24.1, ОС win 10, VSCode IDE. при установке пакета @tensorflow/tfjs-node npm он выдает мне ошибку.
node-pre-gyp install failed with error: Error: Command failed: node-pre-gyp install --fallback-to-build node-pre-gyp ERR! install response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v7/3.10.0/CPU-windows-3.10.0.zip node-pre-gyp WARN Pre-built binaries not installable for @tensorflow/tfjs-node@3.10.0 and node@10.24.1 (node-v64 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v7/3.10.0/CPU-windows-3.10.0.zip gyp ERR! find VS gyp ERR! find VS msvs_version not set from command line or npm config gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt gyp ERR! find VS checking VS2019 (16.11.31729.503) found at: gyp ERR! find VS "C:Program Files (x86)Microsoft Visual Studio2019BuildTools" gyp ERR! find VS - "Visual Studio C core features" missing gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use gyp ERR! find VS looking for Visual Studio 2015 gyp ERR! find VS - not found gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 gyp ERR! find VS gyp ERR! find VS ************************************************************** gyp ERR! find VS You need to install the latest version of Visual Studio gyp ERR! find VS including the "Desktop development with C " workload. gyp ERR! find VS For more information consult the documentation at: gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows gyp ERR! find VS ************************************************************** gyp ERR! find VS gyp ERR! configure error gyp ERR! stack Error: Could not find any Visual Studio installation to use gyp ERR! stack at VisualStudioFinder.fail (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibfind-visualstudio.js:121:47) gyp ERR! stack at findVisualStudio2013 (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibfind-visualstudio.js:74:16) gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibfind-visualstudio.js:351:14) gyp ERR! stack at findVisualStudio2015 (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibfind-visualstudio.js:70:14) gyp ERR! stack at regSearchKeys (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibfind-visualstudio.js:372:16) gyp ERR! stack at regGetValue (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibutil.js:54:7) gyp ERR! stack at C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibutil.js:33:16 gyp ERR! stack at ChildProcess.exithandler (child_process.js:301:5) gyp ERR! stack at ChildProcess.emit (events.js:198:13) gyp ERR! stack at maybeClose (internal/child_process.js:982:16) gyp ERR! System Windows_NT 10.0.10240 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=E:\learning\ReactJS\nextapp\node_modules\@tensorflow\tfjs-node\lib\napi-v7\tfjs_binding.node" "--module_name=tfjs_binding" "--module_path=E:\learning\ReactJS\nextapp\node_modules\@tensorflow\tfjs-node\lib\napi-v7" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=7" "--node_napi_label=napi-v7" gyp ERR! cwd E:learningReactJSnextappnode_modules@tensorflowtfjs-node gyp ERR! node -v v10.24.1 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'C:Program Filesnodejsnode.exe C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --module=E:learningReactJSnextappnode_modules@tensorflowtfjs-nodelibnapi-v7tfjs_binding.node --module_name=tfjs_binding --module_path=E:learningReactJSnextappnode_modules@tensorflowtfjs-nodelibnapi-v7 --napi_version=7 --node_abi_napi=napi --napi_build_version=7 --node_napi_label=napi-v7' (1) node-pre-gyp ERR! stack at ChildProcess.cmd.on (E:learningReactJSnextappnode_modules@mapboxnode-pre-gyplibutilcompile.js:89:23) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) node-pre-gyp ERR! System Windows_NT 10.0.10240 node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "E:\learning\ReactJS\nextapp\node_modules\@mapbox\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd E:learningReactJSnextappnode_modules@tensorflowtfjs-node node-pre-gyp ERR! node -v v10.24.1 node-pre-gyp ERR! node-pre-gyp -v v1.0.4 node-pre-gyp ERR! not ok npm WARN @babel/plugin-syntax-jsx@7.14.5 requires a peer of @babel/core@^7.0.0-0 but none is installed. You must install peer dependencies yourself. npm WARN @typescript-eslint/parser@4.33.0 requires a peer of eslint@^5.0.0 || ^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself. npm WARN eslint-config-next@11.1.2 requires a peer of eslint@^7.23.0 but none is installed. You must install peer dependencies yourself. npm WARN eslint-plugin-jsx-a11y@6.4.1 requires a peer of eslint@^3 || ^4 || ^5 || ^6 || ^7 but none is installed. You must install peer dependencies yourself. npm WARN eslint-plugin-react@7.26.1 requires a peer of eslint@^3 || ^4 || ^5 || ^6 || ^7 but none is installed. You must install peer dependencies yourself. npm WARN eslint-plugin-react-hooks@4.2.0 requires a peer of eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself. npm WARN tsutils@3.21.0 requires a peer of typescript@gt;=2.8.0 || gt;= 3.2.0-dev || gt;= 3.3.0-dev || gt;= 3.4.0-dev || gt;= 3.5.0-dev || gt;= 3.6.0-dev || gt;= 3.6.0-beta || gt;= 3.7.0-dev || gt;= 3.7.0-beta but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-x64@11.1.2 (node_modules@nextswc-darwin-x64): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-x64@11.1.2: wanted {"os":"darwin","arch":"x64"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-arm64@11.1.2 (node_modules@nextswc-darwin-arm64): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-arm64@11.1.2: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-x64-gnu@11.1.2 (node_modules@nextswc-linux-x64-gnu): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-x64-gnu@11.1.2: wanted {"os":"linux","arch":"x64"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modulesfsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @tensorflow/tfjs-node@3.10.0 install: `node scripts/install.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @tensorflow/tfjs-node@3.10.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:UsersAMITAppDataRoamingnpm-cache_logs2021-10-27T07_04_56_747Z-debug.log
Ответ №1:
узел-пре-цыганская ОШИБКА! статус ответа на установку 404 Не найден на https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v7/3.10.0/CPU-windows-3.10.0.zip
узел 10 устарел. узел 16 является текущим, а узел 14-lts. это не просто косметическое решение, которое оказывает значительное влияние на то, как выполняются двоичные привязки к внешним библиотекам. таким образом, версия двоичных файлов napi
v7 больше не является предварительно упакованной.
Комментарии:
1. Я получил ту же ошибку после обновления моего узла с 10 до 16, но все еще сталкиваюсь с той же проблемой, я думаю, что это не ошибка узла, это может быть ошибка библиотеки сборки vscode c .
2. вам никогда не потребуется создавать tfjs-узел из исходных текстов, проблема в том, что двоичный файл предварительной сборки не найден:
node-pre-gyp ERR! install response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v7/3.10.0/CPU-windows-3.10.0.zip