nodecg / nodecg-cli

NodeCG's command line interface. https://github.com/nodecg/nodecg
13 stars 9 forks source link

Line-Endings error on macOs #69

Open Djiit opened 4 years ago

Djiit commented 4 years ago

Hey, got this on my macos last version:

❯ yarn global add nodecg-cli
yarn global v1.22.4
[1/4] 🔍  Resolving packages...
warning nodecg-cli > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Installed "nodecg-cli@6.1.0" with binaries:
      - nodecg
✨  Done in 3.39s.
❯ mkdir nodecg
❯ cd nodecg
❯ nodecg setup
env: node\r: No such file or directory

Any ideas ?

Thanks

EwanLyon commented 4 years ago

Searching it looks like an issue with the way node works on macs and not nodecg. https://stackoverflow.com/questions/43465086/env-node-no-such-file-or-directory-in-mac There are many questions regarding the same issue.

Djiit commented 4 years ago

Actually, the \r made me tilt.

I do use nvm to managed ~8-10 nodejs versions without any issues on many projects.

I tested with a local install (yarn add nodecg; yarn nodecg setup) without any luck.

Djiit commented 4 years ago

Could be related to line-ends format. Some links :

Djiit commented 4 years ago

Err, yes. If I run this :

❯ find node_modules/nodecg-cli -name "*.js*" | xargs dos2unix
dos2unix: converting file node_modules/nodecg-cli/dist/bin/nodecg.js to Unix format...
dos2unix: converting file node_modules/nodecg-cli/dist/index.js to Unix format...
dos2unix: converting file node_modules/nodecg-cli/dist/lib/install-bundle-deps.js to Unix format...
dos2unix: converting file node_modules/nodecg-cli/dist/lib/util.js to Unix format...
dos2unix: converting file node_modules/nodecg-cli/dist/lib/fetch-tags.js to Unix format...
dos2unix: converting file node_modules/nodecg-cli/dist/commands/schema-types.js to Unix format...
dos2unix: converting file node_modules/nodecg-cli/dist/commands/start.js to Unix format...
dos2unix: converting file node_modules/nodecg-cli/dist/commands/index.js to Unix format...
dos2unix: converting file node_modules/nodecg-cli/dist/commands/install.js to Unix format...
dos2unix: converting file node_modules/nodecg-cli/dist/commands/setup.js to Unix format...
dos2unix: converting file node_modules/nodecg-cli/dist/commands/defaultconfig.js to Unix format...
dos2unix: converting file node_modules/nodecg-cli/dist/commands/uninstall.js to Unix format...
dos2unix: converting file node_modules/nodecg-cli/package.json to Unix format...
❯ yarn nodecg setup --help
yarn run v1.22.4
warning package.json: No license field
$ /Users/jtanay/Projects/Lourd/nodecg/node_modules/.bin/nodecg setup --help
Usage: setup [options] [version]

Install a new NodeCG instance

Options:
  -u, --update             Update the local NodeCG installation
  -k, --skip-dependencies  Skip installing npm & bower dependencies
  -h, --help               output usage information
✨  Done in 0.48s.
Djiit commented 4 years ago

I'm not a gulp user, but maybe something like this could help : https://www.npmjs.com/package/gulp-line-ending-corrector

Hoishin commented 4 years ago

Transfered to nodecg-cli repository. It was fixed in this PR https://github.com/nodecg/nodecg-cli/pull/67 but haven't been released since then.

I cannot release right now but will do when I get chance.

fadillzzz commented 4 years ago

I'm running into the same issue on Ubuntu. Is the fix going to be released soon?