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

npmversion shell script has a line ending problem #1

Closed
jbcpollak opened this issue Sep 19, 2016 · 10 comments
Closed

npmversion shell script has a line ending problem #1

jbcpollak opened this issue Sep 19, 2016 · 10 comments
Assignees

Comments

@jbcpollak
Copy link

Similar to this bug: nwutils/nw-builder#75

I had to run dos2unix on node_modules/npmversion/bin/npmversion to get it to work, which doesn't seem sustainable.

@rochejul
Copy link
Owner

Hi

Many thanks for your feedback

Can you tell me a context to try to reproduce the issue ? To show if I fix it (OS version, NodeJs version, NPM version, npmverson version, ...)

Many thanks again, I hope to fix it asap

Cheers

@jbcpollak
Copy link
Author

Sure, we are using OS X 10.11 and NodeJS 6.2.1 with the default npm
installed with it.

It's pretty clear what the problem is, when I open the bin/npmversion
script file it says it has DOS line endings. For it to work properly on a
Mac (and I think Linux) it needs to have Unix line endings. It should work
fine on Windows with Unix line endings too.

Thanks again!

On Tue, Sep 20, 2016, 7:06 AM Roche julien notifications@github.com wrote:

Hi

Many thanks for your feedback

Can you tell me a context to try to reproduce the issue ? To show if I fix
it (OS version, NodeJs version, NPM version, npmverson version, ...)

Many thanks again, I hope to fix it asap

Cheers


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AALgjhEVcZoQyvnSqWLAL8sQ9UncHUPSks5qr75RgaJpZM4KBCOT
.

@jbcpollak
Copy link
Author

Hi, I did some poking around - it looks like the project repo itself is setup correctly. If I had to guess, you are developing on Windows, and you last did an npm publish from your Windows machine. See this bug: npm/npm#12371

I'm not sure what the solution is - you could setup a continuous integration server (travisCI is free for open source projects) to do the deployment for you, or it looks like you could tweak your Windows checkout to solve the problem, I'm not exactly sure how.

It looks like npm hasn't closed the bug yet.

@rochejul
Copy link
Owner

You guess right, I have publish from a Windows laptop :)

This is an interesting. I will use dos2unix and push the modification asap.

If it does not work, I will use my Ubuntu workstation and try to publish with it.

@rochejul
Copy link
Owner

I have push the 1.2.2 version. Can you try this and tell me if it works ?

Otherwise, I try to publish with my Ubuntu workstation

Many thanks

@jbcpollak
Copy link
Author

OK, I think there are ways to setup the config to prevent this problem but
I'm not exactly sure how. Maybe by forcing the line endings on the bin/
directory in the .gitattributes file or something like that

On Tue, Sep 20, 2016, 3:32 PM Roche julien notifications@github.com wrote:

You guess right, I have publish from a Windows laptop :)

This is an interesting. I will use dos2unix and push the modification asap.

If it does not work, I will use my Ubuntu workstation and try to publish
with it.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AALgjpJmKRX8JOGbkIZgDqSeDlZS3twnks5qsDSxgaJpZM4KBCOT
.

@jbcpollak
Copy link
Author

jbcpollak commented Sep 20, 2016

I'll try as soon as I get to my computer

@jbcpollak
Copy link
Author

jbcpollak commented Sep 20, 2016

I just tried using 1.2.2, and I see the bin/npmversion file still has Windows line endings. I deleted my node_modules to make sure I was pulling down the most recent version too.

I ran a script I found online to show the line endings and here is what I see:

~/s/mfp_config_client ❯❯❯ perl -p -e 's[\r\n][WIN\n]; s[(?<!WIN)\n][UNIX\n]; s[\r][MAC\n];' node_modules/npmversion/bin/npmversion
#!/us/bin/env nodeWIN
WIN
'use stict';WIN
WIN
// Nota Bene: do not use es6 syntax hee to deal with a fallbackWIN
va semver = require('semver');WIN
WIN
if (semve.lt(process.version, '4.0.0')) {WIN
    equire('../lib-es5/cli');WIN
WIN
} else {WIN
    // Use ES6 modulesWIN
    equire('../lib/cli');WIN
}WIN

@rochejul
Copy link
Owner

OK I will check if my IDE does not force the windows line breaking

@rochejul
Copy link
Owner

Hi

I try to force the use of 'lf' for javascript files

I deliver the 1.3.0 release

I hope it can help you

Cheers

@rochejul rochejul closed this as completed Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants