I used this code
↓
↓
-----------------------------------------------------------------------------
const BoxSDK = require('./node_modules/box-node-sdk');
const sdkConfig = require('./config.json');
const sdk = BoxSDK.getPreconfiguredInstance(sdkConfig);
const client = sdk.getAppAuthClient('enterprise');
const fs = require('fs');
client.files.getReadStream('fileID', null, function(error, stream) {
if (error) {
// handle error
}
console.log(stream);
// write the file to disk
constoutput=fs.createWriteStream('sample.txt');
stream.pipe(output);
});
------------------------------------------------------------------
but an error occurs
↓
↓
undefined
/home/mg0x42y7214f7c/BOX-app/HTML/node_modules/bluebird/js/release/async.js:49
fn = function () { throw arg; };
^
TypeError: Cannot read property 'pipe' of undefined
I cant download file and i want help.