-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: file.pipe is not a function #78
Comments
+1 |
This error was started after update Gulp to version
|
Specifically it started occurring when Gulp 4 updated from I've had issues with other components as well due to this change (browserify and gulp-modernizr broke for me as well). Unfortunatly it doesn't seem possible to download |
From one of the Gulp core contributors:
|
vinyl-ftp has a similar looking ftp upload file. I was able to get it working after taking a bit of inspiration from this file: First, create a local copy of the gulp-sftp index.js file and save it into your version control. Find this line: Replace it with this: // start upload
if ( file.isStream() ) {
file.contents.pipe( stream );
} else if ( file.isBuffer() ) {
stream.end( file.contents );
} Now reference your new version of gulp-sftp instead of the npm version and it should magically start working again. |
Nice, @Dan503! Submit as a PR to this project? |
I might do it later. I doubt it would do much good though. The owner hasn't made any alterations to this thing in over 2 whole years. |
非常感谢!!! |
@Dan503 Amazing!, thx |
@Dan503 I made changes on the index.js and it certainly fixes the Gulp 4 compatibility. Got a question about the reference to the new version of gulp-sftp (instead of the npm version). Where do you make that change? |
@Dan503 Found it. Yeah, reference is done on the actual gulpfile, where I now call my local index.js, instead of the npm version. |
@costacode the change is made to the copy you made of the gulp-sftp index.js file. |
Oh right, yeah you add that reference to the gulp file you are using gulp-sftp in. So instead of import sftp from "gulp-sftp" You would have import sftp from "./gulp-sftp-copy" Or something like that. The path would be different depending on where you placed the file. |
Great, did exactly that. Thanks for the reply! |
As @Dan503 has a working fork, you can simply install it like this |
问题解决了!感谢~ |
my problem is solved, thx!!! it is worked!! |
It's best not to post comments like "thanks" and "+1". You can show appreciation through using the reaction emojis on the individual comments. |
Is there any fix for this? I am still experiencing same issue.
|
@vladaman |
# 78 (comentário) solved my problem thanks +1 |
Just a few days ago I started seeing this error in my Travis CI builds using gulp-sftp:
Everything was still working locally for me, so I tried clearing out my node_modules and re-installed them, and now I see this same error locally as well.
Given that the gulp-sftp plugin itself hasn't been updated in two years, it appears there is a new issue with one of its dependencies. Has anyone else seen this? I'm having difficulty tracking down the exact source of the problem.
The text was updated successfully, but these errors were encountered: