I had just posted a recent question using client-ftp and was told that package was outdated and was the source of my original problem. As suggested I moved to an package that is still being maintained, which is jsftp. However, I am still having similiar issues. For reference my previous question can be found here. I will still restate my problem as it has changed slightly.
I am new to Angular/Node and am trying to connect to an ftp server.
I am creating a button on the front end like this: <button class="btn btn-primary" (click)="downloadFile()"><i class="fa fa-file-photo-o"></i> Download Screenshot</button>
My new implementation to download is this:
downloadFile(){ console.log('Connecting to sftp...'); var jsftp = require("jsftp"); var ftp = new jsftp({ host: 'localhost', port: 22, user: 'anonymous', pass: 'anonymous' }); console.log('Downloading Screenshot...'); } I realize that I'm not trying to download anything, but for right now I'm only trying to connect first. The problem is that when the click event is fired I get an error saying TypeError: createConnection is not a function. I have no idea what I'm doing wrong. The createConnection function isn't being called anywhere. I'm doing what the documentaion says and other resources seem to indicate the same, such as here.
Node version is: v8.11.3 - maybe that is too outdated?
Netmodule which is not reachable out of the browser and causes the error you mention. This seems to be a general issue.