I am trying to master the node on this screencast

ar nconf = require('nconf'); nconf.argv() .env() .file({ file: path.join(__dirname,'config.json' )}); module.exports=nconf; 

the console gives this error

 /var/www/html/chatnode/config/index.js:4 .file({ file: path.join(__dirname,'config.json' )}); ^ ReferenceError: path is not defined at Object.<anonymous> (/var/www/html/chatnode/config/index.js:4:19) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Module.require (module.js:354:17) at require (internal/module.js:12:17) at Object.<anonymous> (/var/www/html/chatnode/app.js:4:12) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10) 

Please explain the essence (express set the version in the screencast)

Closed due to the fact that off-topic participants Dmitriy Simushev , user194374, aleksandr barakin , Streletz , user207618 Aug 28 '16 at 6:38 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Dmitriy Simushev, Community Spirit, aleksandr barakin, Streletz, Community Spirit
If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    Try setting a variable

     var path = require('path'); 

    after declaring nconf variable.

    Your variable declaration starts with ar

     ar nconf = require('nconf'); 

    Is this how you copied it or is it written in your program? Correct should be var .