TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider'); - ethereum

let provider = new ethers.providers.JsonRpcProvider(url);
^
TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider')
at Object. (e:\Error\readblockchain.js:12:37)
←[90m at Module._compile (node:internal/modules/cjs/loader:1159:14)←[39m
←[90m at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)←[39m
←[90m at Module.load (node:internal/modules/cjs/loader:1037:32)←[39m
←[90m at Module._load (node:internal/modules/cjs/loader:878:12)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m
←[90m at node:internal/main/run_main_module:23:47←[39m
Node.js v18.12.1
PS E:\Error>See The Image-->>
Had the same problem few days ago, turned out to be problem with a beta release of ethers.js.
The fix for me was to downgrade "ethers" to version 5.4 in the package.json, then folder and lastly npm install to install ethers again.
Step 1 :in package.json
{
"dependencies": {
"ethers": "5.4" <<<<<-------------
}
}
Step 2 : Delete node_modules
Step 3 : npm install

Related

Turn a gedcom file in a json one to create a visualisation 3DJS

I'm trying to transform a gedcom file in json this the following code:
"Installation:
The gedcom package can be added as a dependency to use in your code, or if you'd like to just use the CLI, install it globallly:
npm install -g gedcom"
and please find below the error:
Error: Illegal nesting: transition from 1 to NaN
at /usr/local/lib/node_modules/gedcom/dist/cli.js:2:6625
at e (/usr/local/lib/node_modules/gedcom/dist/cli.js:2:6769)
at /usr/local/lib/node_modules/gedcom/dist/cli.js:2:7434
at Object.<anonymous> (/usr/local/lib/node_modules/gedcom/dist/cli.js:2:7535)
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 Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47```
Thank you for your help.
Adrien

There is an error in running mysql (node.js) file in cmd

There is an error in running mysql (node.js) file in cmd. It is showing module not found...
What is the problem occurring?
Please help....
The error:-
C:\Users\mhars>node trial.js
node:internal/modules/cjs/loader:926
throw err;
^
Error: Cannot find module 'C:\Users\mhars\trial.js'
←[90m at Function.Module._resolveFilename (node:internal/modules/cjs/loader:923:15)←[39m
←[90m at Function.Module._load (node:internal/modules/cjs/loader:768:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)←[39m
←[90m at node:internal/main/run_main_module:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
}

IMA.js skeleton install: Cannot find module v8flags

I've tried to install hello world application with this command:
gulp app:hello
I'm getting this error message:
module.js:338
throw err;
^
Error: Cannot find module 'C:\Users\name\AppData\Roaming\npm\node_modules
\gulp\node_modules\v8flags\3.28.73.flags.json'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (C:\Users\name\AppData\Roaming\npm\node_modules
\gulp\bin\gulp.js:25:22)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
Probably you have old version of Gulp.
Try to reinstall with npm install --global gulp.

yo polymer building error

I have just updated my Polymer development tools and I get some errors, although everything was working fine before. Here is what I get when trying 'yo polymer' in the console :
/usr/lib/node_modules/generator-polymer/node_modules/yeoman-generator/lib/base.js:444
this.env.sharedFs.on('change', writeFiles);
^
TypeError: Object # has no method 'on'
at run (/usr/lib/node_modules/generator-polymer/node_modules/yeoman-generator/lib/base.js:444:21)
at Environment.run (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:330:20)
at /usr/lib/node_modules/yo/lib/cli.js:91:9
at Environment.resolver.lookup (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/resolver.js:50:12)
at init (/usr/lib/node_modules/yo/lib/cli.js:66:7)
at pre (/usr/lib/node_modules/yo/lib/cli.js:53:3)
at Object. (/usr/lib/node_modules/yo/lib/cli.js:155:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
Or when I type 'yo' in the console and choose 'polymer' :
/usr/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.all.js:9379
throw e;
^
TypeError: Object # has no method 'on'
at run (/usr/lib/node_modules/generator-polymer/node_modules/yeoman-generator/lib/base.js:444:21)
at Environment.run (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:330:20)
at module.exports (/usr/lib/node_modules/yo/lib/routes/run.js:20:11)
at Router.navigate (/usr/lib/node_modules/yo/lib/router.js:36:30)
at PromptUI.completed (/usr/lib/node_modules/yo/lib/routes/home.js:76:20)
at PromptUI.onCompletion (/usr/lib/node_modules/yo/node_modules/inquirer/lib/ui/prompt.js:69:10)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.completed (/usr/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.all.js:1965:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/usr/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.all.js:1902:14)
at AutoDetachObserverPrototype.completed (/usr/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.all.js:9397:23)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted >(/usr/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.all.js:1902:14)
Any idea on what when wrong with the updates (no error thrown).
Thanks for reading and all the best.
PS : I am running on
Fedora 20
npm 2.5.1
yo 1.4.5
generator-polymer 0.7.0
gem 2.1.11
sass 3.4.12
compass 1.0.3
Update yo (npm install -g yo). I had the same problem.

node.js fnoc module gives error -- probably something simple

I'm sure I'm doing something stupid, but I can't get node-fnoc to work. I have a directory with a simple package.json in it, I have a /config/ directory in that directory with a simple JSON file in it. And, I'm basically just trying to do what they have in their example.
var fnoc = require('fnoc');
fnoc(function(err, configs){
console.log(configs);
});
and this is what I'm getting:
fnoc(function(err, configs){
^
TypeError: object is not a function
at Object.<anonymous> (/opt/backups/readconfig.js:3:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
Any ideas?
The document on github is for version 0.2.2
You need to install fnoc#0.2.2
npm install fnoc#0.2.2
Run your js
node your.js
Output:
{ package:
{ name: 'asdf',
dependencies:
{ express: '*',
jade: '*',
Version is in the changelog file:
https://github.com/jprichardson/node-fnoc/blob/master/CHANGELOG.md