S
S
Sergey Beloventsev2016-08-23 23:00:42
Node.js
Sergey Beloventsev, 2016-08-23 23:00:42

Why is there an error with path.join?

I'm trying to master node by this screencast
here is the code

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

console throws 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 what is the point (express put the version in the screencast)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2016-08-23
@Sergalas

const path = require('path');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question