When executing npm --version on Windows 7 x64, I get:
net.js:10
const cares = process.binding('cares_wrap');
^
Error: EFILE
at net.js:10:23
at NativeModule.compile (bootstrap_node.js:523:7)
at NativeModule.require (bootstrap_node.js:464:18)
at createWritableStdioStream (internal/process/stdio.js:155:19)
at process.getStdout [as stdout] (internal/process/stdio.js:10:14)
at module.exports (C:\Program Files\nodejs\node_modules\npm\node_modules\npm
log\node_modules\set-blocking\index.js:2:11)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules
\npmlog\log.js:11:1)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
net.js:10
const cares = process.binding('cares_wrap');
^
Error: EFILE
at net.js:10:23
at NativeModule.compile (bootstrap_node.js:523:7)
at NativeModule.require (bootstrap_node.js:464:18)
at tty.js:4:13
at NativeModule.compile (bootstrap_node.js:523:7)
at NativeModule.require (bootstrap_node.js:464:18)
at createWritableStdioStream (internal/process/stdio.js:142:19)
at process.getStdout [as stdout] (internal/process/stdio.js:10:14)
at module.exports (C:\Program Files\nodejs\node_modules\npm\node_modules\npm
log\node_modules\set-blocking\index.js:2:11)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules
\npmlog\log.js:11:1)
May this be that that computer is a Virtual Machine ? On the other hand, the node --version command give a correct output.
Related
Node js version : v18.13.0
npm version: 8.19.3
Cmd : node .\node_modules\bassmaster\examples\batch.js
Os : Windows 10
Error: settings.routes = Config.enable(settings.routes);
^
TypeError: Cannot create property 'routes' on number '8080'
at internals.setup (G:\RCE_Bassmaster\node_modules\hapi\lib\core.js:595:21)
at new module.exports.internals.Core (G:\RCE_Bassmaster\node_modules\hapi\lib\core.js:54:46)
at new module.exports (G:\RCE_Bassmaster\node_modules\hapi\lib\server.js:22:18)
at internals.main (G:\RCE_Bassmaster\node_modules\bassmaster\examples\batch.js:65:22)
at Object. (G:\RCE_Bassmaster\node_modules\bassmaster\examples\batch.js:88:11)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
I was expecting the server to start
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)
node:fs:723
handleErrorFromBinding(ctx);
^
Error: EIO: i/o error, read
at Object.readSync (node:fs:723:3)
at tryReadSync (node:fs:433:20)
at Object.readFileSync (node:fs:471:19)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1120:18)
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. (C:\Program Files\nodejs\node_modules\npm\lib\utils\exit-handler.js:4:22)
at Module._compile (node:internal/modules/cjs/loader:1103:14) {
errno: -4070,
syscall: 'read',
code: 'EIO'
}
I am new to Node.js and while following one of the tutorials at tutorialspoint http://www.tutorialspoint.com/nodejs/nodejs_callbacks_concept.htm
I tried to run one simple program, but I am unable to run it successfully
var fs = require("fs");
var data = fs.readFileSync('./input.txt');
console.log(data.toString());
console.log("Program Ended");
This is the error message which I get:
C:\Users\Jack\Desktop\Nodee>node main.js
fs.js:549
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open 'C:\Users\Jack\Desktop\Nodee\input.txt'
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at Object.<anonymous> (C:\Users\Jack\Desktop\Nodee\main.js:3:15)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
Here is the Screenshot of my folder inside my desktop
http://i.imgur.com/O6Bi1qc.png
I have used this path but it failed as well:
C:\Users\Jack\Desktop\Nodee
I am newbie and I am writing a simple program based Node.js.
everything is fine until I added this line:
process.addListener('SIGINT', function(){ console.log( 'Sigint test.' ); } );
Run: Node sample.js
I got following message:
node.js:203
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: No such module
at EventEmitter.<anonymous> (node.js:361:27)
at Object.<anonymous> (D:\Nodejs\MySample\sample.js:13:9)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.<anonymous> (module.js:470:10)
at EventEmitter._tickCallback (node.js:195:26)
Environment:
Windows XP sp2
Node.js 0.5.9 for Windows
help me please...