kentico-cloud-model-generator-utility

Hey guys

Not sure if this is the right place to post this. I'm starting on a new cloud project soon and was hoping to try out the typescript sdk and model generator utility.

I'm getting an error when trying to use kc-generate (on osx)
env: node\r: No such file or directory

I believe this is related to: https://github.com/npm/npm/issues/12371

Some other examples of this error:
https://github.com/typicode/json-server/issues/571
https://github.com/Azure/iothub-explorer/issues/6

Best Answer

Answers

  • Hi Sam,

    Could you possibly try looking at this SO answer which suggest that unistalling and installing new/updated version of Node/NPM can help with this issue?

    I looked at the issues you referenced, but to be honest I'm not sure what to take from them as the code seems to be fine and I haven't found any suggestions of how the code could be changed. I believe the issue is caused by this line:

    '#!/usr/bin/env node'

    in the npm package, which expects node to be installed.

  • samsam Member
    edited October 2017

    Sorry I should have been more specific.

    When publishing from Windows, depending on how developers set up Git, it's possible that binary scripts will end up in the tarball with CR LF line endings, instead of the LF expected by Unix / OS X. This can cause failures when those scripts are invoked.

    looks like the line endings are off. It might be a packaging problem. investigating...
    [edit] I'm guessing we're falling into this somehow: npm/npm#12371

    There's seems to be a linebreak error:
    0.10.2 fails to run on OS X.
    Changing the linebreak type fixes the error.

    Countless other repos and SO threads with exactly the same thing. All saying that line endings need to be fixed for it to run on OSX.

    The SO thread you linked was someone unable to run any npm commands at all so I don't think that's my problem. I use npm all day every day with lots of other packages.

    Are you able to look into the line endings?

  • samsam Member

    Sorry I should have been more specific

    When publishing from Windows, depending on how developers set up Git, it's possible that binary scripts will end up in the tarball with CR LF line endings, instead of the LF expected by Unix / OS X. This can cause failures when those scripts are invoked.

    --

    looks like the line endings are off. It might be a packaging problem. investigating...
    [edit] I'm guessing we're falling into this somehow: npm/npm#12371

    --

    There's seems to be a linebreak error in node_modules/.bin/json-server:
    0.10.2 fails to run on OS X.
    Changing the linebreak type fixes the error.

    The SO thread you linked is someone that can't run any npm commands at all. I don't think this is my problem.

    There are lots of other threads on this same issue. All of them resolved by removing windows line endings.

    Are you able to look at the line endings for me?

  • samsam Member

    Sorry for the delayed response. Tried the new version and it's working perfectly!

    Thanks for your help.

Sign In or Register to comment.