I'm trying to run node app server.js with the imported code from GitHub but getting below error in the console. Not sure why I'm getting this error.
Error :util.js:959 Object.setPrototypeOf(ctor.prototype, superCtor.prototype);
TypeError: Object.setPrototypeOf called on null or undefined
at Function.setPrototypeOf (native)
at Object.exports.inherits (util.js:959:10)
at Object.<anonymous> (businessvalidationexception.js:1:17)
at Module._compile (module.js:541:32)
at loader (/home/vagrant/Desktop/..../node_modules/babel-core/node_modules/babel-register/lib/node.js:126:5)
at Object.require.extensions.(anonymous function) [as .js] (/home/vagrant/Desktop/..../node_modules/babel-core/node_modules/babel-register/lib/node.js:136:7)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
Related
Error message:
[nodemon] starting `babel-node index.js`
C:\Users\Zara Gunner\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-manager.js:328
throw e;
^
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of #babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "#babel/core" or "babel-core" to see what is calling Babel. (While processing preset: "C:\\Users\\Zara Gunner\\FYP\\fourthyearproject\\fourthyearproject\\node_modules\\#babel\\preset-env\\lib\\index.js")
at throwVersionError (C:\Users\Zara Gunner\FYP\fourthyearproject\fourthyearproject\node_modules\#babel\helper-plugin-utils\lib\index.js:78:11) at Object.assertVersion (C:\Users\Zara Gunner\FYP\fourthyearproject\fourthyearproject\node_modules\#babel\helper-plugin-utils\lib\index.js:28:5)
at C:\Users\Zara Gunner\FYP\fourthyearproject\fourthyearproject\node_modules\#babel\preset-env\lib\index.js:251:7
at C:\Users\Zara Gunner\FYP\fourthyearproject\fourthyearproject\node_modules\#babel\helper-plugin-utils\lib\index.js:22:12
at C:\Users\Zara Gunner\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-manager.js:317:46
at Array.map (<anonymous>)
at OptionManager.resolvePresets (C:\Users\Zara Gunner\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-manager.js:275:20)
at OptionManager.mergePresets (C:\Users\Zara Gunner\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-manager.js:264:10)
at OptionManager.mergeOptions (C:\Users\Zara Gunner\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-manager.js:249:14)
at OptionManager.init (C:\Users\Zara Gunner\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
at compile (C:\Users\Zara Gunner\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-register\lib\node.js:103:45)
at loader (C:\Users\Zara Gunner\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-register\lib\node.js:144:14)
at Object.require.extensions.<computed> [as .js] (C:\Users\Zara Gunner\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-register\lib\node.js:154:7)
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 Object.<anonymous> (C:\Users\Zara Gunner\AppData\Roaming\npm\node_modules\babel-cli\lib\_babel-node.js:154:22)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155: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 {
code: 'BABEL_VERSION_UNSUPPORTED',
version: '6.26.3',
range: '^7.0.0-0'
}
I have a JavaScript application that is bundled into a client-side application and run in the browser.
An old version of the application used to have a variable assignment like this:
const API_ROOT_URL = `http://${window.location.hostname}:8000/`;
This would presumably get interpolated in the browser.
However, this code now throws a webpack error on webpack 4.42.0:
ReferenceError: window is not defined
at Object.<anonymous> (/usr/src/app/src/client_config.js:4:32)
at Module._compile (/usr/src/app/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (/usr/src/app/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at Object.<anonymous> (/usr/src/app/webpack.config.js:1:99)
at Module._compile (/usr/src/app/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (/usr/src/app/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at WEBPACK_OPTIONS (/usr/src/app/node_modules/webpack-cli/bin/utils/convert-argv.js:114:13)
at requireConfig (/usr/src/app/node_modules/webpack-cli/bin/utils/convert-argv.js:116:6)
at /usr/src/app/node_modules/webpack-cli/bin/utils/convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports (/usr/src/app/node_modules/webpack-cli/bin/utils/convert-argv.js:121:15)
at /usr/src/app/node_modules/webpack-cli/bin/cli.js:71:45
at Object.parse (/usr/src/app/node_modules/yargs/yargs.js:567:18)
at /usr/src/app/node_modules/webpack-cli/bin/cli.js:49:8
at Object.<anonymous> (/usr/src/app/node_modules/webpack-cli/bin/cli.js:366:3)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/usr/src/app/node_modules/webpack/bin/webpack.js:156:2)
It seems that the interpolation is happening at the time the bundle is created, when window doesn't exist.
Can I get the intended behavior?
I am trying to generate TypeScript definition file (.d.ts) from JavaScript file (*.js)...It has converted all the files expect on Java Script file which contains the following statement
return Java.type('com.test.TestExample').START_ELEMENT
Error Message:
ReferenceError: Java is not defined
at Function.get ATTRIBUTE [as ATTRIBUTE] (eval at <anonymous> (C:\Users\uuk\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\run.js:71:64), <anonymous>:95:27)
at getResult (C:\Users\uuk\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:148:47)
at getTopLevelDeclarations (C:\Users\uuk\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:124:17)
at Object.generateIdentifierDeclarationFile (C:\Users\uuk\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:68:20)
at Object.<anonymous> (C:\Users\uuk\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\run.js:71:24)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787: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)
Can you please tell me what is this issue and how to fix this?
I cloned the code from github and run it via Atom. But the error thrown.
the open source is udemy-downloader-gui
TypeError: Cannot read property 'on' of undefined
at Object. (C:\Users\sbai\github\git1\index.js:88:5)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
I tried to run a node app that I've cloned from
https://github.com/jensoleg/mongoose-timeseries
So I just cloned it and npm install and dependencies but when I ran an example file it gives this error! I've looked at the core code but I don't know what is the problem exactly.
mti.init('test', {interval: 1}); //second: Boolean, minute: Boolean
^
TypeError: undefined is not a function
at Object.<anonymous> (/Users/Kanin/Desktop/test/test.js:7:5)
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)
at startup (node.js:129:16)
at node.js:814:3