Skip to content

Commit

Permalink
Fix for windows installation #7341 (#8122)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
0x5ca1ab1e authored Jan 9, 2024
1 parent b004ab6 commit f224f1d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tfjs-node/scripts/deps-stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit f224f1d

Please sign in to comment.