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

"env: node\r: No such file or directory" for CLI CSS Lint on OSX #82

Closed
oryband opened this issue Jun 22, 2011 · 15 comments
Closed

"env: node\r: No such file or directory" for CLI CSS Lint on OSX #82

oryband opened this issue Jun 22, 2011 · 15 comments
Labels

Comments

@oryband
Copy link

oryband commented Jun 22, 2011

I'm getting this error when installing CSS Lint via npm on my Mac OSX Snow Leopard 10.6.7:

csslint "env: node\r: No such file or directory"

This is what npm info csslint returns:

npm info it worked if it ends with ok
npm info using npm@0.3.18
npm info using node@v0.4.8
{ name: 'csslint',
  description: 'CSSLint',
  'dist-tags': { latest: '0.2.0' },
  maintainers: 'nzakas <nzakas@yahoo-inc.com>',
  time: 
   { '0.1.0': '2011-06-15T17:58:52.378Z',
     '0.2.0': '2011-06-18T17:07:28.549Z' },
  author: 'Nicholas C. Zakas',
  repository: 
   { type: 'git',
     url: 'git://github.com/stubbornella/csslint.git' },
  version: '0.2.0',
  os: [ 'darwin', 'linux' ],
  contributors: 'Nicole Sullivan',
  engines: { node: '>=0.2.0' },
  directories: { lib: 'lib' },
  main: './lib/csslint-node.js',
  bin: { csslint: './cli.js' },
  licenses: 
   { type: 'BSD',
     url: 'http://www.freebsd.org/copyright/freebsd-license.html' },
  dependencies: {},
  devDependencies: {},
  dist: 
   { shasum: 'c10f2d6c275e1ca319346f598098b21154e827b0',
     tarball: 'http://registry.npmjs.org/csslint/-/csslint-0.2.0.tgz' },
  scripts: {} }
npm ok

Perhaps the newlines are still in Unix form, instead of OSX form?

@oryband
Copy link
Author

oryband commented Jun 22, 2011

As soon as I get this working, I'm gonna add CSS Lint support to Vim via Syntastic plugin, so you better fix this quickly. :)

@nzakas
Copy link
Contributor

nzakas commented Jun 22, 2011

Unfortunately, I don't have a Mac so it's a little bit difficult for me to make changes and see if it's working or not. Would you be willing to do a little hacking to see if you can get it working?

@shinuza
Copy link

shinuza commented Jun 22, 2011

Same issue here (OSX 10.6.7), that's because the file is in DOS mode. Both this solutions work :

  • dos2unix the cli.js coming from npm
  • installing the version in build/npm/cli.js from this repo

Nicholas, have you published the package since you pulled my last commit?

@nzakas
Copy link
Contributor

nzakas commented Jun 22, 2011

Nope, not yet. Waiting to get a few more fixes in before pushing. If your changes already fixed this issue, then yay!!! I'm planning on pushing 0.3.0 this weekend.

@shinuza
Copy link

shinuza commented Jun 22, 2011

OK, let's wait until you release the next version. As I mentioned earlier I was able to reproduce the bug using the current npm version whereas the git HEAD version doesn't present this problem.

@eriwen
Copy link
Member

eriwen commented Jun 22, 2011

This affects at least Debian Squeeze as well.

BTW, I can get this to work if I run:

node /path/to/csslint/cli.js file

@iturgeon
Copy link

I can verify dos2unix fixes the mentioned issue

@xentek
Copy link

xentek commented Jun 23, 2011

dos2unix sorted me out. I was also able to make it work before dos2unix with eriwen's method

@al-the-x
Copy link

Confirmed both workarounds. I converted to Unix-style line endings with dos2unix. The "shebang" line in cli.js can't have the DOS-style line endings or "node" it isn't properly recognized by "env". May break in Windows?

@shinuza
Copy link

shinuza commented Jun 23, 2011

@al-the-x No, it should not break on Windows since node doesn't work outside of cygwin.

@oryband
Copy link
Author

oryband commented Jun 25, 2011

Well, any progress on this issue?

@shinuza
Copy link

shinuza commented Jun 25, 2011

The new npm package has not been published yet, @nzakas any ETA?

@nzakas
Copy link
Contributor

nzakas commented Jun 25, 2011

Hopefully before EOD today (if not, then definitely tomorrow).

@nzakas
Copy link
Contributor

nzakas commented Jun 26, 2011

Try updating now and let me know how it goes:

sudo npm update -g csslint

@oryband
Copy link
Author

oryband commented Jun 26, 2011

It can confirm it now works.

Couple o' notes though:

  1. No need for sudo or -g though, npm install csslint works just fine.
  2. Why use sudo in the first place? Note I installed Node using Mac's Homebrew which bypasses the need for sudo.
  3. Using -g returns an error:
~$ npm install -g csslint
npm info it worked if it ends with ok
npm info using npm@0.3.18
npm info using node@v0.4.8
npm ERR! couldn't read package.json in .
npm ERR! Error installing .
npm ERR! Error: ENOENT, No such file or directory 'package.json'
npm ERR! Report this *entire* log at <http://github.com/isaacs/npm/issues>
npm ERR! or email it to <npm-@googlegroups.com>
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm ERR! System Darwin 10.7.0
npm ERR! argv { remain: [],
npm ERR! argv   cooked: 
npm ERR! argv    [ 'install',
npm ERR! argv      '-g',
npm ERR! argv      'csslint' ],
npm ERR! argv   original: 
npm ERR! argv    [ 'install',
npm ERR! argv      '-g',
npm ERR! argv      'csslint' ] }
npm not ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants