node:internal/modules/cjs/loader:959
throw err;
^
Error: Cannot find module 'ethers'
Require stack:
D:\Blockchain\deploy.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (D:\Blockchain\deploy.js:1:16)
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 Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'D:\Blockchain\deploy.js' ]
}
can anyone help me to find the solution to this error?
Related
I'm watching a two year-old tutorial from YouTube, and I stuck at here.
throw error;
^
SetOptionError: mongodb+srv://BilalAhmed:password/Test: "mongodb+srv://BilalAhmed:password/Test" is not a valid option to set
at Mongoose.set (F:\Webdevelopment\Node JS\node_modules\mongoose\lib\index.js:249:17)
at Object.<anonymous> (F:\Webdevelopment\Node JS\NodeWithMongoDB.js:5:10)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
errors: {
'mongodb+srv://BilalAhmed:password/Test': SetOptionInnerError [MongooseError]: "mongodb+srv://BilalAhmed:password/Test" is not a valid option to set
at Mongoose.set (F:\Webdevelopment\Node JS\node_modules\mongoose\lib\index.js:251:33)
at Object.<anonymous> (F:\Webdevelopment\Node JS\NodeWithMongoDB.js:5:10)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
}
}
const mongoose = require('mongoose')
mongoose.set('mongodb+srv://BilalAhmed:password/Test',
{
useNewUrlParser: false,
useUnifiedTopology: true
}).then(() => { console.warn("Mongodb connected") })
I just wanted to connect with Mongo DB server and perform CRUD operation.
Whenever I do
const Razorpay = require('razorpay');
There's an error coming up in node_modules/razorpay during running the server
node_modules\request-promise-core\configure\request2.js:34
var originalInit = options.request.Request.prototype.init;
^
TypeError: Cannot read property 'prototype' of undefined
at module.exports (node_modules\request-promise-core\configure\request2.js:34:48)
at Object. (node_modules\request-promise\lib\rp.js:28:1)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object. (node_modules\razorpay\dist\api.js:7:15)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object. (node_modules\razorpay\dist\razorpay.js:7:11)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
at require (internal/modules/cjs/helpers.js:88:18)
SyntaxError: await is only valid in async functions and the top level bodies of modules
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1032:15)
at Module._compile (node:internal/modules/cjs/loader:1067:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157: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:77:12)
at node:internal/main/run_main_module:17:47
[nodemon] app crashed - waiting for file changes before starting...
You can add async at the beginning of your function.
async function example() {
const response = await doSomethingAsync();
console.log(response);
}
Error: Cannot find module 'C:\Users\The_T\Downloads\generative-art-node-main\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 Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
any idea how to pass this step? it is my last step before it generates my NFT's .
I have the following file structure:
/avro.js
/node_modules/...
/package.json
/package-lock.json
I have run:
npm install javro yargs
In my avro.js I do:
#!/usr/bin/env node
const { javro, SchemaRegistryAvroFetcher } = require('javro');
const yargs = require("yargs");
const options = yargs
.scriptName("javro")
.positional('inpath', {
type: 'string',
describe: 'path to JSON Schema file to convert'
})
.positional('outpath', {
type: 'string',
describe: 'path to save converted Avro Schema'
})
.help()
.argv;
When I try to run the script I get:
./avro.js --help
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'javro'
Require stack:
- /Users/anentropic/Documents/Dev/Personal/myproj/avro.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> (/Users/anentropic/Documents/Dev/Personal/myproj/avro.js:2:46)
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 Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/Users/anentropic/Documents/Dev/Personal/myproj/avro.js' ]
}
Node.js isn't my first language, but I thought this should work?