can't find module 'cucumber' - node.js

I have installed protractor and cucumber globally.
When I run this code using protractor:
$ protractor ./config/cucumber.conf.js
I get the following error:
[15:54:03] E/configParser - Error code: 105
[15:54:03] E/configParser - Error message: failed loading configuration file ./config/cucumber.conf.js
[15:54:03] E/configParser - Error: Cannot find module 'cucumber'
Require stack:
- D:\AutomationTesting\Cucumberbasics\node_modules\protractor-cucumber-framework\lib\cucumberLoader.js
- D:\AutomationTesting\Cucumberbasics\node_modules\protractor-cucumber-framework\index.js
- D:\AutomationTesting\Cucumberbasics\config\cucumber.conf.js
- C:\Users\Admin-asus\AppData\Roaming\npm\node_modules\protractor\built\configParser.js
- C:\Users\Admin-asus\AppData\Roaming\npm\node_modules\protractor\built\launcher.js
- C:\Users\Admin-asus\AppData\Roaming\npm\node_modules\protractor\built\cli.js
- C:\Users\Admin-asus\AppData\Roaming\npm\node_modules\protractor\bin\protractor
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.module.exports.load (D:\AutomationTesting\Cucumberbasics\node_modules\protractor-cucumber-framework\lib\cucumberLoader.js:19:24)
at Object.<anonymous> (D:\AutomationTesting\Cucumberbasics\node_modules\protractor-cucumber-framework\index.js:8:33)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)`enter code here`
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)

Related

Fix error `Module build failed: Error: Cannot find module 'ajv'`

I'm getting the error Module build failed: Error: Cannot find module 'ajv' when trying to run vue-cli-service serve --mode dev in my application.
ajv is being installed as a dependency of other packages, it's not a direct dependency in my package.json. I'm using versions node: v14.17.6 and npm : 6.14.15
npm install runs perfectly, the error only appears when running vue-cli-service serve --mode dev
The full error trace is as follows:
ERROR in ./src/main.ts
Module build failed: Error: Cannot find module 'ajv'
Require stack:
- /Users/<user>/node_modules/schema-utils/dist/validate.js
- /Users/<user>/node_modules/schema-utils/dist/index.js
- /Users/<user>/node_modules/cache-loader/dist/index.js
- /Users/<user>/node_modules/cache-loader/dist/cjs.js
- /Users/<user>/<project>/node_modules/webpack/lib/ProgressPlugin.js
- /Users/<user><project>/node_modules/progress-webpack-plugin/index.js
- /Users/<user><project>/node_modules/#vue/cli-service/lib/commands/serve.js
- /Users/<user>/<project>//node_modules/#vue/cli-service/lib/Service.js
- /Users/<user>/<project>/node_modules/#vue/cli-service/bin/vue-cli-service.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/Users/<user>/node_modules/schema-utils/dist/validate.js:15:13)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/Users/<user>/node_modules/schema-utils/dist/index.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
webpack compiled with 1 error
No issues found.
Any idea what could be the issue?

Im stuck at error cannot find module in discord.js

I used the discord.js guide for Economy System and i get this error:
Error: Cannot find module './models/UserItems.js'
Require stack:
- /home/runner/Banky/dbObjects.js
- /home/runner/Banky/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:102:18)
at Object.<anonymous> (/home/runner/Banky/dbObjects.js:12:19)
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)
Can anybody help me how to fix it?
This is my path:
You are requiring UserItems.js not UsersItems.js.
... = require('./models/UserItems.js'); ❌
... = require('./models/UsersItems.js'); ✅

Vuepress can't find module Require stack:

I'm getting this error when I use the command yarn dev
is there any way to fix this?
PS C:\Users\Maximiliano\Desktop\guia front-end method\docs> yarn dev
yarn run v1.22.19
$ vuepress dev src
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'chalk'
Require stack:
- C:\Users\Maximiliano\Desktop\guia front-end method\docs\node_modules\#vuepress\shared-utils\lib\datatypes.js
- C:\Users\Maximiliano\Desktop\guia front-end method\docs\node_modules\#vuepress\shared-utils\lib\index.js
- C:\Users\Maximiliano\Desktop\guia front-end method\docs\node_modules\vuepress\lib\checkEnv.js
- C:\Users\Maximiliano\Desktop\guia front-end method\docs\node_modules\vuepress\cli.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:102:18)
at Object.<anonymous> (C:\Users\Maximiliano\Desktop\guia front-end method\docs\node_modules\#vuepress\shared-utils\lib\datatypes.js:7:33)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159: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) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Maximiliano\\Desktop\\guia front-end method\\docs\\node_modules\\#vuepress\\shared-utils\\lib\\datatypes.js',
'C:\\Users\\Maximiliano\\Desktop\\guia front-end method\\docs\\node_modules\\#vuepress\\shared-utils\\lib\\index.js',
'C:\\Users\\Maximiliano\\Desktop\\guia front-end method\\docs\\node_modules\\vuepress\\lib\\checkEnv.js',
'C:\\Users\\Maximiliano\\Desktop\\guia front-end method\\docs\\node_modules\\vuepress\\cli.js'
]
}
error Command failed with exit code 1.
Snapshot of the above error

Error: Cannot find module 'react-router/lib/getRouteParams'

I did npm -install -react-router-dom and all the good nonense, I have react-router in the node modules. I cannot seem to find the solution to this problem.
Below is the Error Code.
Compiling your contracts...
===========================
> Compiling .\src\contracts\EthSwap.sol
> Compiling .\src\contracts\Migrations.sol
> Compiling .\src\contracts\Token.sol
> Artifacts written to C:\Users\ssand\AppData\Local\Temp\test--2500-cjuPSMOV4zat
> Compiled successfully using:
- solc: 0.5.16+commit.9c3226ce.Emscripten.clang
Error: Cannot find module 'react-router/lib/getRouteParams'
Require stack:
- C:\Users\ssand\eth_swap\node_modules\react-bootstrap\lib\Breadcrumb.js
- C:\Users\ssand\eth_swap\test\EthSwap.test.js
- C:\Users\ssand\AppData\Roaming\npm\node_modules\truffle\node_modules\mocha\lib\mocha.js
- C:\Users\ssand\AppData\Roaming\npm\node_modules\truffle\node_modules\mocha\index.js
- C:\Users\ssand\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (C:\Users\ssand\eth_swap\node_modules\react-bootstrap\lib\Breadcrumb.js:28:37)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Object.require.extensions.<computed> [as .js] (C:\Users\ssand\eth_swap\node_modules\babel-register\lib\node.js:152:7)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (C:\Users\ssand\eth_swap\test\EthSwap.test.js:8:17)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at loader (C:\Users\ssand\eth_swap\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions.<computed> [as .js] (C:\Users\ssand\eth_swap\node_modules\babel-register\lib\node.js:154:7)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at C:\Users\ssand\AppData\Roaming\npm\node_modules\truffle\node_modules\mocha\lib\mocha.js:390:36
at Array.forEach (<anonymous>)
Truffle v5.4.19 (core: 5.4.19)
Node v14.17.5
PS C:\Users\ssand\eth_swap>
npm install react-router-dom --save
If it did not work, try to verify your path env variable and add the directory that you installed react module.

Error: Cannot find module 'extend' when running 'node skeleton build' in terminal

When Im compiling my .less file, I need to run node skeleton build in terminal, but instead of compiling, this error occur:
Building target: default
=============== ERROR ===============
{ Error: Cannot find module 'extend'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/opt/lampp/htdocs/htlgi_london/lib/build/getSettings.js:3:14)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3) code: 'MODULE_NOT_FOUND' }
Please show me how to solve this problem.

Resources