node-cron: missing dependency: uuid
this is the reference to the module: https://github.com/node-cron/node-cron/blob/master/src/scheduled-task.js#L6
I can not understand how a test can be real when devDependencies are required for running it. I mean,
- if I install devDependencies I have nyc, that depends on uuid, and the test will pass
- when I run it in real world, with a simple
npm i, I have no devDependencies packages, so it really say that uuid is missing.
I have no idea how to post a failing test and a patch fixing it.
The required patch is to add uuid dependency in package.json
For now, my workaround is to add uuid as an explicit dependency in my project.
This is the output of the error after npm i and node index.js:
Error: Cannot find module 'uuid'
Require stack:
- /home/node/code/node_modules/node-cron/src/scheduled-task.js
- /home/node/code/node_modules/node-cron/src/node-cron.js
- /home/node/code/models/cronschedule.js
- /home/node/code/index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object.<anonymous> (/home/node/code/node_modules/node-cron/src/scheduled-task.js:6:14)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object.<anonymous> (/home/node/code/node_modules/node-cron/src/node-cron.js:3:23)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/node/code/node_modules/node-cron/src/scheduled-task.js',
'/home/node/code/node_modules/node-cron/src/node-cron.js',
'/home/node/code/models/cronschedule.js',
'/home/node/code/index.js'
]
}
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 26
- Comments: 18 (1 by maintainers)
i have the same problem
This issue is already reported here: #355
Same here ðŸ˜
Same here
just ran into this issue.
@Juneezee I replaced
uuidwithcrypto.randomUUIDas per suggestion from @weyert and submitted another pull-request. I think reducing dependencies is always the better option. Let me know if you have any objections.same here
Same problem
I have the same problem… (´;ω;`)ウゥゥ
for now I’m using this patch, if anyone is interested
with npm and yarn is different
pnpm: (root of package.json)
in project root create this file
patches/node-cron@3.0.1.patch