freyr-js icon indicating copy to clipboard operation
freyr-js copied to clipboard

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'timers'

Open Smaltin opened this issue 2 years ago • 2 comments

When attempting to launch freyr on my system, I encounter the following issue:

C:\Users\sterl>freyr
internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'timers' imported from C:\Users\sterl\AppData\Roaming\nvm\v14.20.0\node_modules\freyr\cli.js
←[90m    at new NodeError (internal/errors.js:322:7)←[39m
←[90m    at packageResolve (internal/modules/esm/resolve.js:732:9)←[39m
←[90m    at moduleResolve (internal/modules/esm/resolve.js:773:18)←[39m
←[90m    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:887:11)←[39m
←[90m    at Loader.resolve (internal/modules/esm/loader.js:89:40)←[39m
←[90m    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)←[39m
←[90m    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)←[39m
←[90m    at link (internal/modules/esm/module_job.js:75:36)←[39m {
  code: ←[32m'ERR_MODULE_NOT_FOUND'←[39m
}

I am currently running [email protected], installed by running the command npm install --global [email protected]

I am using Node 14.20.0 using nvm-windows to downgrade my node version

I am also using a symbolic link to convert python3 to python running Python v3.10.6 since I ran into an issue where it couldn't find python3

Smaltin avatar Aug 04 '22 07:08 Smaltin

Upon running npm install --global timers I am now encountering a different issue,

C:\Freyr>npm install --global timers
+ [email protected]
added 1 package from 1 contributor in 0.356s

C:\Freyr>freyr
internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\sterl\AppData\Roaming\nvm\v14.20.0\node_modules\timers\promises' imported from C:\Users\sterl\AppData\Roaming\nvm\v14.20.0\node_modules\freyr\cli.js
←[90m    at new NodeError (internal/errors.js:322:7)←[39m
←[90m    at finalizeResolution (internal/modules/esm/resolve.js:318:11)←[39m
←[90m    at moduleResolve (internal/modules/esm/resolve.js:776:10)←[39m
←[90m    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:887:11)←[39m
←[90m    at Loader.resolve (internal/modules/esm/loader.js:89:40)←[39m
←[90m    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)←[39m
←[90m    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)←[39m
←[90m    at link (internal/modules/esm/module_job.js:75:36)←[39m {
  code: ←[32m'ERR_MODULE_NOT_FOUND'←[39m
}

I have a feeling the dependency is not listed properly

Smaltin avatar Aug 04 '22 07:08 Smaltin

Spotted the issue, thanks for raising it. This new release uses features that aren't supported in older versions of node. You have to update to node v16 or higher to have it work.

I'll add a patch to make it support v14 and higher, but I can't go any lower than that because of esm support and other features.

miraclx avatar Aug 04 '22 07:08 miraclx

Can you confirm upgrading nodejs fixes the issue?

miraclx avatar Aug 04 '22 13:08 miraclx

hey same issue but in mine it's for the conf file...

ErrorCaptureStackTrace(err);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'conf' imported from /Users/myusername/freyr/cli.js at new NodeError (node:internal/errors:372:5) at packageResolve (node:internal/modules/esm/resolve:954:9) at moduleResolve (node:internal/modules/esm/resolve:1003:20) at defaultResolve (node:internal/modules/esm/resolve:1218:11) at ESMLoader.resolve (node:internal/modules/esm/loader:580:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18) at ModuleWrap. (node:internal/modules/esm/module_job:80:40) at link (node:internal/modules/esm/module_job:78:36) { code: 'ERR_MODULE_NOT_FOUND' } Using node 16

csshlok avatar Aug 04 '22 14:08 csshlok

@csshlok, did you npm install?

miraclx avatar Aug 04 '22 16:08 miraclx

yeah I did

csshlok avatar Aug 04 '22 18:08 csshlok

@csshlok Include a screenshot of the following.

$ git clone https://github.com/miraclx/freyr-js
$ cd freyr-js
$ npm install
$ node cli.js

miraclx avatar Aug 05 '22 00:08 miraclx

Screenshot 2022-08-05 at 8 18 47 AM here you go

csshlok avatar Aug 05 '22 02:08 csshlok

From this I can see that npm install failed for the same reason as in #200. I addressed the issue in there.

miraclx avatar Aug 05 '22 02:08 miraclx

yeah, just saw that, I'll try installing via npm Take me back to version 6 days man

csshlok avatar Aug 05 '22 02:08 csshlok

@miraclx issue got resolved thx, now I've ran into another issue mentioned in #296

csshlok avatar Aug 05 '22 04:08 csshlok