You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(base) raphy@pc:~/pytorchjsPlay$ nano basic.js
import { torch, torchvision } from 'pytorchjs';
(base) raphy@pc:~/pytorchjsPlay$ node basic.js
file:///home/raphy/pytorchjsPlay/basic.js:1
import { torch, torchvision } from 'pytorchjs';
^^^^^
SyntaxError: Named export 'torch' not found. The requested module 'pytorchjs' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'pytorchjs';
const { torch, torchvision } = pkg;
at ModuleJob._instantiate (internal/modules/esm/module_job.js:104:21)
at async ModuleJob.run (internal/modules/esm/module_job.js:149:5)
at async Loader.import (internal/modules/esm/loader.js:166:24)
at async Object.loadESM (internal/process/esm_loader.js:68:5)
(base) raphy@pc:~/pytorchjsPlay$
basic_2,js :
import pkg from 'pytorchjs';
const { torch, torchvision } = pkg;
(base) raphy@pc:~/pytorchjsPlay$ node basic_2.js
internal/modules/cjs/loader.js:880
const err = new Error(message);
^
Error: Cannot find module '@babel/runtime/helpers/interopRequireDefault'
Require stack:
- /home/raphy/pytorchjsPlay/node_modules/pytorchjs/lib/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/home/raphy/pytorchjsPlay/node_modules/pytorchjs/lib/index.js:3:30)
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)
at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/home/raphy/pytorchjsPlay/node_modules/pytorchjs/lib/index.js' ]
}
(base) raphy@pc:~/pytorchjsPlay$
I faced the same problem/error as @raphael10-collab. I indeed installed the package via yarn and no error was found. Below are logs during the installation process:
yarn add v1.22.19
warning package.json: No license field
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
warning No license field
success Saved 1 new dependency.
info Direct dependencies
└─ pytorchjs@0.1.5
info All dependencies
└─ pytorchjs@0.1.5
Done in 143.35s.
basic_2,js :
package.json :
{
"type": "module",
"dependencies": {
"pytorchjs": "^0.1.5"
}
}
node : v14.15.5
OS. Ubuntu 20.04
The text was updated successfully, but these errors were encountered: