简体   繁体   中英

I am new to node.js.while writing a code iam getting an syntax error unexpected identifier at config=

var fs = require('fs'),
path = require('path'),
Twit = require('twit'),
config = require(path.join(__dirname, 'config.js'));

var T = new Twit(config);

T.post('statuses/update', { status: 'My first tweet!' }, function(err, data, response) {
  console.log(data)
});
var fs = require('fs'),
path = require('path'),
Twit = require('twit'),

change upper statements to this

var fs = require('fs');
path = require('path');
Twit = require('twit');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM