Open vaibhavgatne opened 6 years ago
Have you done npm install
before creating your download and upload functions?
Thanks @markpython86, that's right @vaibhavgatne, as you can see in https://github.com/noodny/node-ftp-client/blob/master/package.json#L34, ftp
is a dependency of this module.
module.js:549 throw err; ^
Error: Cannot find module 'ftp' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. (H:\Techm\FTP\node-ftp-client-master\lib\client.js:4:7)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
My java script as below
var ftpClient = require('./client.js'),
config = {
host: 'localhost',
port: 21,
user: 'anonymous',
password: 'anonymous@'
},
options = {
logging: 'basic'
},
client = new ftpClient(config, options);
client.connect(function () {
});