Answer the question
In order to leave comments, you need to log in
Why don't npm modules (request, sugar) work?
When connecting the request and sugar modules, there are no errors, but when trying to use their API (for example, request.get), the exception "TypeError: request.get is not a function" immediately takes off. The same goes for functions from Sugar. What could be the problem and how to fix it? The version of NodeJS is the latest, Windows 10.
Answer the question
In order to leave comments, you need to log in
Isn't that how it works?
var request = require('request');
var Sugar = require('sugar');
Sugar.extend();
var fs = require('fs');
request('http://google.com/doodle.png').pipe(
fs.createWriteStream('doodle.png')
);
var a = ['a','b','a'];
console.log(a.count('a'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question