From f224f1db873bd7f4f5ca930c85a8d49afd3c9dba Mon Sep 17 00:00:00 2001 From: Victor Moreno G <46457486+vicmmg@users.noreply.github.com> Date: Tue, 9 Jan 2024 17:55:09 -0600 Subject: [PATCH] Fix for windows installation #7341 (#8122) * Fix for windows installation #7341 Fix a problem with the installation on windows. My problem on windows was that `./lib/napi-v9` directory didn't exist and `./scripts/deps-stage.js` on line **60** needed the path to symlink or copy the dll. My fix was to make sure that the directory `napi-v9` exists with: `await fs.mkdir(path.dirname(destLibTensorFlowPath), {recursive: true})`; I'm solving the copy issue with this code. * Fix fs.mkdir usage in deps-stage.js --- tfjs-node/scripts/deps-stage.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tfjs-node/scripts/deps-stage.js b/tfjs-node/scripts/deps-stage.js index 0ec0d113b52..39522038590 100644 --- a/tfjs-node/scripts/deps-stage.js +++ b/tfjs-node/scripts/deps-stage.js @@ -22,6 +22,7 @@ const copy = util.promisify(fs.copyFile); const os = require('os'); const rename = util.promisify(fs.rename); const symlink = util.promisify(fs.symlink); +const mkdir = util.promisify(fs.mkdir); const { depsLibTensorFlowFrameworkPath, depsLibTensorFlowPath, @@ -57,6 +58,7 @@ async function symlinkDepsLib() { throw new Error('Destination path not supplied!'); } try { + await mkdir(path.dirname(destLibTensorFlowPath), {recursive: true}); await symlink( path.relative( path.dirname(destLibTensorFlowPath), depsLibTensorFlowPath),