riazXrazor / udemy-dl

Nodejs script to download a udemy.com course, for personal offline use
282 stars 67 forks source link

Getting an error #9

Closed eralpkor closed 6 years ago

eralpkor commented 6 years ago

Running on Mac OS X 10.12.6 Getting an error "env: node\r: No such file or directory"

chaitanya11 commented 6 years ago

Yeah i am also getting same error /usr/bin/env: ‘node\r’: No such file or directory

chaitanya11 commented 6 years ago

@eralpkor i had the same error but got resolve like this npm install -g udemy-dl

this command gives

/usr/local/bin/udl -> /usr/local/lib/node_modules/udemy-dl/index.js
/usr/local/lib
└── udemy-dl@0.0.10 

then install dos2unix like this

brew install dos2unix

then convert udemy-dl index.jsfile tp unix format like this

dos2unix /usr/local/lib/node_modules/udemy-dl/index.js

then try to run udl

riazXrazor commented 6 years ago

Thanks I'll hv a look into it, come up with a fix soon.

On Sat 18 Nov, 2017, 2:43 PM Chaitanya Garikipati, notifications@github.com wrote:

@eralpkor https://github.com/eralpkor i had the same error but got resolve like this npm install -g udemy-dl

this command gives

/usr/local/bin/udl -> /usr/local/lib/node_modules/udemy-dl/index.js /usr/local/lib └── udemy-dl@0.0.10

then install dos2unix like this

brew install dos2unix

then convert udemy-dl index.jsfile tp unix format like this

dos2unix /usr/local/lib/node_modules/udemy-dl/index.js

then try to run udl

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/riazXrazor/udemy-dl/issues/9#issuecomment-345429502, or mute the thread https://github.com/notifications/unsubscribe-auth/AMlUez1KithOPK0Y6ICPAtt4tMLY78ZRks5s3p-ogaJpZM4QaEcy .

mattwelke commented 6 years ago

Isn't this just a matter of carriage return characters being accidentally left in the source code, making it only runnable on Windows? Fix should be as simple as replacing all instances of \r\n with \n in all of the source files. The problem probably came from proper Git configuration from one of the devs, with them changing it to commit Windows-style. Committing UNIX-style is cross-platform.

riazXrazor commented 6 years ago

i hv added .gitattributes file i think this will fix the issue

zhiyuxia commented 6 years ago

Running on Mac OS X 10.11.6 Getting an error "env: node\r: No such file or directory"

danielbintar commented 6 years ago

Running on Ubuntu Getting an error /usr/bin/env: ‘node\r’: No such file or directory

JosimarCamargo commented 6 years ago

It was happening the same error with me, and then I update my node to v8.9.1 and then the error "env: node\r: No such file or directory" is not happening more, the application starts well, asks me email, password and url, next to checking course url, I am getting this error:

Checking course url... /home/josimar/.nvm/versions/node/v8.9.1/lib/node_modules/udemy-dl/lib/core.js:108 callback(b.match(/data-course-id="(\d+)"/)[1]); ^

TypeError: Cannot read property '1' of null at Request._callback (/home/josimar/.nvm/versions/node/v8.9.1/lib/node_modules/udemy-dl/lib/core.js:108:51) at Request.self.callback (/home/josimar/.nvm/versions/node/v8.9.1/lib/node_modules/udemy-dl/node_modules/request/request.js:186:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request. (/home/josimar/.nvm/versions/node/v8.9.1/lib/node_modules/udemy-dl/node_modules/request/request.js:1163:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at IncomingMessage. (/home/josimar/.nvm/versions/node/v8.9.1/lib/node_modules/udemy-dl/node_modules/request/request.js:1085:12) at Object.onceWrapper (events.js:313:30) at emitNone (events.js:111:20)

rmemon commented 6 years ago

Hi @riazXrazor I am facing same issue on ubuntu system,

/usr/bin/env: ‘node\r’: No such file or directory

can one can provide solution for the same

riazXrazor commented 6 years ago

this issue has been fixed, plz update to 0.0.13