Skip to content
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

Warning: normalize #42

Open
luisgagocasas opened this issue Jan 17, 2016 · 17 comments
Open

Warning: normalize #42

luisgagocasas opened this issue Jan 17, 2016 · 17 comments
Assignees

Comments

@luisgagocasas
Copy link

I have this problem because susede ?

Running "ftp_push:sample" (ftp_push) task
Warning: Cannot call method 'normalize' of undefined Use --force to continue.

@JasonEtco
Copy link

I'm having this problem as well. Using this package in the same project as usual, so it must be some new update thats causing it.

@Robert-W
Copy link
Owner

Hmm, there was an update in september to change path.normalize to path.posix.normalize and all other calls to path to use path.posix. What system are you guys using?

I wonder if changing the calls from path.posix to path or path.win32 would resolve this issue.

Also, are you running the latest version(0.4.4)?

@JasonEtco
Copy link

I'm using Ubuntu, if that helps. JSFTP version is 1.5.3, and I am using 0.4.4 for this. I don't know JS well enough to change the calls you mentioned, but if you point me in the right direction I can figure it out.

@Robert-W
Copy link
Owner

Hey @JasonEtco. I can put up a sample file for you to try using or push a patch version to see if it fixes it for you, might be a day or two before I get the time to make the changes, test, and push a new build . In the meantime if you want to test something out and see if it fixes it for you, I am including instructions below.

  1. In grunt-ftp-push/tasks/ftp_push.js around line 157, change the following: basepath = path.posix.normalize(options.dest); to: basepath = path.normalize(options.dest);
  2. In grunt-ftp-push/tasks/utils.js do a search or find and look for all cases of path.posix and switch those for just path. So path.posix.join or path.posix.normalize would become path.join and path.normalize. There should only be 5 cases.

If you don't want to try it out, don't worry, Ill try to push another build out in the next day or two that will check for the existence of this before using it. Based on the error message provided Warning: Cannot call method 'normalize' of undefined, this is the only thing I can think of that would be causing it.

@JasonEtco
Copy link

@Robert-W thanks for getting back. I tried that out, and while I do not get the original error message, I now get: Fatal Error: connect ETIMEDOUT

@Robert-W
Copy link
Owner

Hmm, can you post your config that your using and any terminal output you are seeing? That sounds like it is having trouble connecting to your FTP server.

@JasonEtco
Copy link

@Robert-W Sure. Here is a screenshot of the full terminal output (fyi I'm using Jekyll and some other Grunt build tasks):

http://i.imgur.com/fbj7ugb.png

The relevant content of my Gruntfile.js:

ftp_push: {
          jasonetcovitch: {
            options: {
              authKey: "key1",
              host: "jasonetcovitch.com",
              dest: "/public_html/",
              port: 21
            },
            files: [
              {
                expand: true,
                cwd: '_site/',
                src: [ "**/*" ]
              }
            ]
          }
        },

If you need anything else, let me know! Thanks again for the help.

@luisgagocasas
Copy link
Author

I found the solution to my problem . was that had nodejs and npm date. so now I have .

-v nodejs
v5.4.1

NPM -v
3.5.3

Now if it works perfectly and grunt -ftp -push .

In advance thanks for the concern.

@luisgagocasas luisgagocasas reopened this Jan 19, 2016
@Robert-W
Copy link
Owner

Thanks @luisgagocasas.

@JasonEtco Can you verify that you are able to connect to those folders on your server?
Im not seeing any errors from the initial code, the first output should be something like this:
<username> successfully authenticated or Could not authenticate with <username>

@Robert-W
Copy link
Owner

If the change fixed the path issue, I may close this ticket and reopen a new one for the timeout error as that seems like a different issue.

@JasonEtco
Copy link

@Robert-W

It seems that my original webhost, GoDaddy, changed their login system to require ftp. when connecting to the server. They didn't tell me that -.-

But now I have no problems, everything is perfect.
Thanks so much for your help!

@Robert-W Robert-W added the bug label Jan 19, 2016
@Robert-W Robert-W self-assigned this Jan 19, 2016
@Robert-W
Copy link
Owner

@JasonEtco.

Great, glad to hear.

Im gonna leave this open as a reminder to make those updates to path.posix for the next version, so keep using the one you edited for now, but there will be a new release marked as 1.0.0 coming this week sometime with those fixes.

@Robert-W
Copy link
Owner

Note to self:
Use path.posix if it exists, otherwise use path in it's place.

@JasonEtco
Copy link

Actually I'm not sure you need to, updating Node also fixed the original issue for me. Might have just been some version issues

@Robert-W Robert-W removed the bug label Jan 19, 2016
@Robert-W
Copy link
Owner

Ok, that's great. I will leave it as is then. Thanks for the update.

@PatrikValkovic
Copy link

I have got same problem.
Debian GNU/Linux 8 (jessie) (Linux 3.16.0-4-amd64)
npm 1.4.21
nodejs v0.10.29
After replaced file.posix with just file all worked for me.

@Robert-W
Copy link
Owner

Robert-W commented Aug 3, 2016

@PatrikValkovic Thanks for reporting this, I will try to take a look this evening and see if I can figure out the issues and push out a patch so you don't have to make those changes anymore.

@Robert-W Robert-W reopened this Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants