Learn Programming through LIVE online classrooms

Node.js Discussion Forums

There's no such thing as a stupid question. Ask. Discuss. Learn.

can you help me?

Write a program called newlines.js that uses a single synchronous filesystem operation to read a file and print the number of newlines it contains to the console (stdout). The file to be read in will come in as the 3rd command line argument. An example of a command would be: node newlines.js something.txt

Ghazal Ahm 8 months ago
  • Roselin Delta

    throw er; // Unhandled 'error' event

    Error: listen EADDRINUSE: address already in use :::8000
    at Server.setupListenHandle [as _listen2] (net.js:1270:14)
    at listenInCluster (net.js:1318:12)
    at Server.listen (net.js:1405:7)
    at Object. (/home/roselinj/node-rest-sample/server.js:7:10)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    Emitted 'error' event at:
    at emitErrorNT (net.js:1297:8)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
    [nodemon] app crashed - waiting for file changes before starting...

  • Whitelisted Links