question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module %project_path%\node_modules\@tensorflow\tfjs-node\lib\napi-v5\tfjs_binding.node'

See original GitHub issue

I import @tensorflow/tfjs-node in app.js and got this error when I run it.

TensorFlow.js version

@tensorflow/tfjs-node v1.5.1

Browser version

nodejs version

Code to reproduce the bug / link to feature request

internal/modules/cjs/loader.js:800
    throw err;
    ^

Error: Cannot find module 'D:\TESA\tfjs-test\part2\node_modules\@tensorflow\tfjs-node\lib\napi-v5\tfjs_binding.node'
Require stack:
- D:\TESA\tfjs-test\part2\node_modules\@tensorflow\tfjs-node\dist\index.js
- D:\TESA\tfjs-test\part2\app.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (D:\TESA\tfjs-test\part2\node_modules\@tensorflow\tfjs-node\dist\index.js:46:16)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Module.require (internal/modules/cjs/loader.js:852:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'D:\\TESA\\tfjs-test\\part2\\node_modules\\@tensorflow\\tfjs-node\\dist\\index.js',
    'D:\\TESA\\tfjs-test\\part2\\app.js'
  ]
}

Please anyone help me I’m new to tensorflowjs

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

17reactions
RezaRahmaticommented, Dec 22, 2020

I get same error using version 1.7.0 or 1.7.4

`! Error: The specified module could not be found. \?\C:\projects\digital-verification\api\node_modules@tensorflow\tfjs-node\lib\napi-v5\tfjs_binding.node at Object.Module._extensions…node (internal/modules/cjs/loader.js:1122:18) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at Object.<anonymous> (C:\projects\digital-verification\api\node_modules@tensorflow\tfjs-node\dist\index.js:58:16) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) ! We were unable to load your functions code. (see above)

  • It appears your code is written in Typescript, which must be compiled before emulation. [4:10:42 PM] Found 0 errors. Watching for file changes.`

I ran npm run build-addon-from-source in node_modules/@tensorflow/tfjs-node and still same error

Update

moving \node_modules\@tensorflow\tfjs-node\deps\lib\tensorflow.dll to \node_modules\@tensorflow\tfjs-node\lib\napi-v5\ solved the issue

2reactions
kangyizhangcommented, Jan 16, 2020

@dnjooiopa

  1. can you check what is inside D:\TESA\tfjs-test\part2\node_modules\@tensorflow\tfjs-node\lib\napi-v5?
  2. try go to D:\TESA\tfjs-test\part2\node_modules\@tensorflow\tfjs-node and run npm run build-addon-from-source, paste the output and try if it works
Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot find module [Node npm Error Solved] - freeCodeCamp
In my case, I got it like this "Module not found: Error: Can't resolve 'react-icons/fa' in 'C:\Users\user\Desktop\Projects\Address Locator\ ...
Read more >
How do I resolve "Cannot find module" error using Node.js?
Using npm install installs the module into the current directory only (in a subdirectory called node_modules ). Is app.js located under ...
Read more >
Error: Cannot find module 'bcrypto.node' · Issue #127 - GitHub
i got some error here D:\DataGalang\test-cepot\hs-airdrop\node_modules\loady\lib\loady.js:156 throw err; ^ Error: Cannot find module ...
Read more >
Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package/module ...
Read more >
[Solution] Error: Cannot Find Module "nodemailer" - Courier
This error occurs when you have not installed the nodemailer library in your Node.js application. Solution - Here's How To Resolve It. First,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found