iamshaunjp/node-js-playlist

Readable Streams

Closed this issue · 2 comments

you tube exercise 14 -Readable stream code not working in real PS C:\Users\Ravindra patel\Source\Repos\nodejsExercise\readfile> node index.js
internal/modules/cjs/loader.js:631
throw new ERR_INVALID_ARG_TYPE('id', 'string', id);
^

TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type undefined
at Module.require (internal/modules/cjs/loader.js:631:11)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (C:\Users\Ravindra patel\Source\Repos\nodejsExercise\readfile\index.js:1:72)
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)
PS C:\Users\Ravindra patel\Source\Repos\nodejsExercise\readfile>

var http=require(http);
var fs=require(fs);
var Myreadstream=fs.createReadStream(__dirname +'./read.txt','utf8');
Myreadstream.on('data',function(chunk){
console.log('new chunk received');
console.log(chunk);
});
this code throws an error

i Get it