Hacklone / private-bower

A simple private bower registry
Other
667 stars 131 forks source link

Can't run private-bower #272

Open sergey-suloev opened 6 years ago

sergey-suloev commented 6 years ago

pi@haniraspi:~/bower$ sudo private-bower --config private-bower-config.json /usr/bin/env: ‘node\r’: No such file or directory

tylercrocker commented 6 years ago

I'm also getting this... Using Ubuntu 16.04 and here are all my node/npm/bower installs:

root@nile:/home/tyler# which node
/usr/bin/node
root@nile:/home/tyler# which npm
/usr/bin/npm
root@nile:/home/tyler# which bower
/usr/local/bin/bower
root@nile:/home/tyler# node --version
v4.2.6
root@nile:/home/tyler# npm --version
3.5.2
root@nile:/home/tyler# bower --version
1.8.2

My config file looks like this (with hostname and password pulled out):

{
    "registryFile": "./bowerRepository.json",
    "timeout": 144000,
    "server": {
        "hostName": "__HOSTNAME__",
        "port": 80
    },
    "public": {
        "disabled": true
    },
    "authentication": {
        "enabled": true,
        "key": "__PASSWORD__"
    },
    "repositoryCache": {
        "cachePrivate": false,
        "git": {
            "enabled": false,
            "cacheDirectory": "./gitRepoCache",
            "host": "localhost",
            "port": 6789,
            "publicAccessURL" : null,
            "refreshTimeout": 10
        },
        "svn": {
            "enabled": false,
            "cacheDirectory": "./svnRepoCache",
            "host": "localhost",
            "port": 7891,
            "publicAccessURL" : null,
            "refreshTimeout": 10
        }
    },
    "proxySettings" : {
        "enabled": false,
        "host": "proxy",
        "username": "name",
        "password" : "pass",
        "port": 8080,
        "tunnel": false
    },
    "log4js" : {
        "enabled": false,
        "configPath" : "log4js.conf.json"
    }
}

But I'm seeing the error that @sergey-suloev posted above regardless of specifying a config or not.

A coworker of mine was able to run the scripts that are included in this repo manually in a node console (on the server we're trying to set this up on) and they worked, but that can't actually be our solution.

Any thoughts would be appreciated!

sergey-suloev commented 6 years ago

@tylercrocker As far as I remember this issue can be fixed by removing Windows-style line endings from the private-bower script. I don't have a bash example at hand, try sed.

siseko commented 6 years ago

I also had the same issue and converted the line endings using dos2unix private-bower. Weird thing is that I never got the issue on my local but I got it on a server we use. The version of private-bower is the same on both machines so I'm not sure how one has CRLF line endings. I spent about half a day trying to figure out what the issue is. Hope this helps someone else.

tylercrocker commented 6 years ago

@sergey-suloev Thanks for the feedback, we were assuming it was something like that, but I wasn't able to immediately find this. Sounds like @siseko was able to get it to work, but it IS weird that it even has this issue?

We no longer have a need for this, so we won't be pursing it any further; but hopefully a more straight-forward solution can be found for others?

Thanks!