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

Does not work in Linux (Ubuntu 18.04) #2

Closed
drewwiens opened this issue Jan 8, 2019 · 5 comments
Closed

Does not work in Linux (Ubuntu 18.04) #2

drewwiens opened this issue Jan 8, 2019 · 5 comments

Comments

@drewwiens
Copy link

drewwiens commented Jan 8, 2019

Steps to reproduce:

  1. Create new project (npm init)
  2. Add move-cli (npm install --save move-cli)
  3. Add script and test file (touch test.txt and add a script to package.json: "move": "move-cli test.txt test2.txt")
  4. Run script (npm run move)

Result:

$ npm run move

> [email protected] move /home/andrew/Desktop/scratch
> move-cli test.txt test2.txt

/usr/bin/env: ‘node\r’: No such file or directory
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] move: `move-cli test.txt test2.txt`
npm ERR! spawn ENOENT

Expected:
Should be able to move a file in linux (Ubuntu 18.04 x64 in this case)

@drewwiens
Copy link
Author

drewwiens commented Jan 8, 2019

It looks like the cli.js file contains Windows line endings when pulled from the npm repository. The cli.js from the GitHub repo works fine. In the test project, when I go into node_modules/move-cli and run dos2unix cli.js to change the line endings from /r/n (Windows/DOS line endings) to /n (Unix/Linux line endings) it works. So I think just the npm repository for this project needs to be fixed.

@koenig-dominik
Copy link
Owner

I can't reproduce your issue, I did the steps exactly like you, also on Ubuntu 18.04 and it just works.
I had a look at the file and it was actually CLRF.
With which node version did you try to execute the script?
I tried it with Node v10.15.1 & NPM 6.4.1

@koenig-dominik
Copy link
Owner

I have just released a new version, where the CLRF line endings should be just LF, please let me know, if that fixed your issue. Thanks!

@drewwiens
Copy link
Author

Interesting, I think it's because I was using Yarn. I just tried both versions and 1.2.0 works when installed with npm, but not with Yarn. Now the new version (1.2.1) seems to work when installed either with npm or Yarn.

@drewwiens
Copy link
Author

Yup, looks like there are open CRLF issues on Yarn: yarnpkg/yarn#5480

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

2 participants