this is the response i got when i run node file
`node:internal/modules/cjs/loader:1210
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: /lib64/libc.so.6: version GLIBC_2.25' not found (required by /home/mhmd8/nodevenv/dad.online/16/lib/node_modules/argon2/lib/binding/napi-v3/argon2.node) at Object.Module._extensions..node (node:internal/modules/cjs/loader:1210:18) at Module.load (node:internal/modules/cjs/loader:1004:32) at Function.Module._load (node:internal/modules/cjs/loader:839:12) at Module.require (node:internal/modules/cjs/loader:1028:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (/home/muhamad8/nodevenv/resumeku.online/16/lib/node_modules/argon2/argon2.js:9:25) at Module._compile (node:internal/modules/cjs/loader:1126:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10) at Module.load (node:internal/modules/cjs/loader:1004:32) at Function.Module._load (node:internal/modules/cjs/loader:839:12) { code: 'ERR_DLOPEN_FAILED' }
how i can solve this problem, thanks!
Related
when I check the node version and npm version in my nodejs terminal everything appears to be working fine. When I try doing something in VS code and run the, "npm -v", I get all this stuff below. I tried opening the folder via powershell and running npm -v but get the same stuff.
Node version is showing: v16.17.0
C:\Program Files\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110
class SocksProxyAgent extends agent_base_1.Agent {
^
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110:44)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:174:29)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\remote.js:7:18)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
C:\Program Files\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110
class SocksProxyAgent extends agent_base_1.Agent {
^
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110:44)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:174:29)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\remote.js:7:18)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
I'm working on a Cypress project that was working fine.
But recently, it started throwing some errors. I searched for reasons as to why I was getting the errors. I found out that in my index.js file the export.module had a line to throw an error if the option algorithm was not set as below.
My question is where should I set the said algorithms and how?
Here's the git repository of the project
https://github.com/Leealp/BugsFixed2
module.exports = function(options) {
....................................................................
if (!options.algorithms) throw new Error('algorithms should be set');
var secretCallback = options.secret;
if (!isFunction(secretCallback)){
secretCallback = wrapStaticSecretInCallback(secretCallback);
}
....................
....................
}
The error is below:
C:\Users\AlphaLy\Documents\Coding\Cypress Web Automation upload\CypressLastPractices\node-express-sequelize-nextjs(L)\node_modules\express-jwt\lib\index.js:22
if (!options.algorithms) throw new Error('algorithms should be set');
^
Error: algorithms should be set
at module.exports (C:\Users\AlphaLy\Documents\Coding\Cypress Web Automation upload\CypressLastPractices\node-express-sequelize-nextjs(L)\node_modules\express-jwt\lib\index.js:22:34)
at Object.<anonymous> (C:\Users\AlphaLy\Documents\Coding\Cypress Web Automation upload\CypressLastPractices\node-express-sequelize-nextjs(L)\auth.js:20:13)
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:102:18)
at Object.<anonymous> (C:\Users\AlphaLy\Documents\Coding\Cypress Web Automation upload\CypressLastPractices\node-express-sequelize-nextjs(L)\api\users.js:3: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:102:18)
at Object.<anonymous> (C:\Users\AlphaLy\Documents\Coding\Cypress Web Automation upload\CypressLastPractices\node-express-sequelize-nextjs(L)\api\index.js:8:17)
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:102:18)
at Object.<anonymous> (C:\Users\AlphaLy\Documents\Coding\Cypress Web Automation upload\CypressLastPractices\node-express-sequelize-nextjs(L)\app.js:17:13)
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 Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
PS C:\Users\AlphaLy\Documents\Coding\Cypress Web Automation upload\CypressLastPractices\node-express-sequelize-nextjs(L)>
I am getting below error while trying to execute below command
npm-check-updates
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module '../../package.json'
Require stack:
C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js:11:40)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js'
]
}
I see the location C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js exist. Can you help me solving this error?
I found the workaround in location https://github.com/raineorshine/npm-check-updates/issues/990
I changed "../../package.json" to "../../../package.json" in /home/ledsun/.local/share/nvm/v17.0.1/lib/node_modules/npm-check-updates/build/src/bin/cli.js:11, then the ncu runs expected.
I have node.js version
C:\helloworld-webpart>node -v
v10.24.1
and when i run this command using cmd windows i got this error:-
C:\helloworld-webpart>yo #microsoft/sharepoint
C:\Users\mohan\AppData\Roaming\npm\node_modules\yo\node_modules\yeoman-environment\lib\resolver.js:70
filePatterns: lookups.flatMap(prefix => [`${prefix}/*/index.ts`, `${prefix}/*/index.js`, `${prefix}/*/index.cjs`, `${prefix}/*/index.mjs`]),
^
TypeError: lookups.flatMap is not a function
at Environment.resolver.lookup (C:\Users\mohan\AppData\Roaming\npm\node_modules\yo\node_modules\yeoman-environment\lib\resolver.js:70:27)
at init (C:\Users\mohan\AppData\Roaming\npm\node_modules\yo\lib\cli.js:130:7)
at pre (C:\Users\mohan\AppData\Roaming\npm\node_modules\yo\lib\cli.js:89:3)
at Object.<anonymous> (C:\Users\mohan\AppData\Roaming\npm\node_modules\yo\lib\cli.js:219:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
any advice?
I am trying to write the unit test case using mocha and chai but I am getting the error:-Cannot find module './--require.js when I run the test case.
the script is:- "test": "mocha --require babel-core/register 'server/api/**/*.test.js'"
full error:-
D:\gitlab-to-azure\blik-app\node_modules\yargs\yargs.js:1163
else throw err
^
Error: Cannot find module './--require.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.getConstants (D:/gitlab-to-azure/blik-app/server/config/environment/index.js:12:16)
at Object.<anonymous> (D:/gitlab-to-azure/blik-app/server/app.js:20:25)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at loader (D:\gitlab-to-azure\blik-app\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (D:\gitlab-to-azure\blik-app\node_modules\babel-register\lib\node.js:154:7)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (D:/gitlab-to-azure/blik-app/server/api/group/group.test.js:2:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at loader (D:\gitlab-to-azure\blik-app\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (D:\gitlab-to-azure\blik-app\node_modules\babel-register\lib\node.js:154:7)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\mocha.js:334:36
at Array.forEach (<anonymous>)
at Mocha.loadFiles (D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\mocha.js:331:14)
at Mocha.run (D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\mocha.js:809:10)
at Object.exports.singleRun (D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\cli\run-helpers.js:108:16)
at exports.runMocha (D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\cli\run-helpers.js:142:13)
at Object.exports.handler.argv [as handler] (D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\cli\run.js:292:3)
at Object.runCommand (D:\gitlab-to-azure\blik-app\node_modules\yargs\lib\command.js:242:26)
at Object.parseArgs [as _parseArgs] (D:\gitlab-to-azure\blik-app\node_modules\yargs\yargs.js:1087:28)
at Object.parse (D:\gitlab-to-azure\blik-app\node_modules\yargs\yargs.js:566:25)
at Object.exports.main (D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\cli\cli.js:68:6)
at Object.<anonymous> (D:\gitlab-to-azure\blik-app\node_modules\mocha\bin\mocha:164:29)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)```
Folder Structure:-
server
api
groups
controller.js
model.js
groups.test.js
You would need to qualify for the full path for the mocha runner, you can try something like this
"test": "./node_modules/.bin/mocha --compilers js:#babel/register 'server/api/**/*.test.js'"