// Edit
Turns out the functions have been changed to node.* … couldnt find it anywhere documented tho
I’m switching to a new server and now I can’t get IPFS running.
Whenever I use the files.add / files.get function it says that it’s not a function.
It’s working on the other server and I have absolutely no clue why… The ready event is called
let ipfs = require('ipfs');
let node = new ipfs();
node.on('ready', () => {
console.log("Ready!");
node.files.get('QmZRBkfjDqZsHcPKANem6woDaFK6PvchJYFM5uRU4ayhvB', (err, files) => {
if (err) throw err;
console.log('Go it!');
});
});
process.stdin.resume(); // To keep the process running
root@dnlk:/home/**# node test.js
Swarm listening on /ip4/127.0.0.1/tcp/4002/ipfs/**
Swarm listening on /ip4/***.***.***.***/tcp/4002/ipfs/**
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/ipfs/**
Ready!
(node:12038) UnhandledPromiseRejectionWarning: TypeError: node.files.get is not a function
at IPFS.node.on (/home/**/test.js:8:13)
at IPFS.emit (events.js:189:13)
at waterfall (/home/**/node_modules/ipfs/src/core/boot.js:71:10)
at /home/**/node_modules/ipfs/node_modules/async/internal/once.js:12:16
at next (/home/**/node_modules/ipfs/node_modules/async/waterfall.js:21:29)
at /home/**/node_modules/ipfs/node_modules/async/internal/onlyOnce.js:12:16
at self.start (/home/**/node_modules/ipfs/src/core/boot.js:60:9)
at done (/home/**/node_modules/ipfs/src/core/components/start.js:25:7)
at /home/**/node_modules/ipfs/node_modules/async/internal/parallel.js:39:9
at /home/**/node_modules/ipfs/node_modules/async/internal/once.js:12:16
I’m on Ubuntu 18.04 (previously Debian 9.8)