generator icon indicating copy to clipboard operation
generator copied to clipboard

./bin/www issue with github commit and deployment

Open vickyRathee opened this issue 5 years ago • 4 comments

Expressjs default template has .bin/www to start the node js app. But bin folder is never committed to github (I can't find anyway until now).

So my codeCommit pipeline fails -

-------------------------------------
/var/log/nodejs/nodejs.log
-------------------------------------
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

image

Should I delete the bin folder and rename www with server.js ? What exactly the www does? If I put it on main directory with rename..Will it cause any problem?

Or anyway to push it on git commit?

vickyRathee avatar May 03 '20 14:05 vickyRathee

If it is not being added with get add bin/www it sounds like you may have a git ignore ignoring that directory or file. You can generate your project with --git option to create a .gitignore with the expected filters.

dougwilson avatar May 03 '20 17:05 dougwilson

No, it's nowhere in .gitignore. I saw other people have similar issue and can't upload /bin folder https://stackoverflow.com/questions/27575228/cant-push-bin-directory-to-github

vickyRathee avatar May 04 '20 02:05 vickyRathee

@vickyrathee Do you happen to have bin in a global gitignore file?

ryhinchey avatar May 04 '20 02:05 ryhinchey

You can rule out if it's a a gitignore issue with a few commands.

Check what files are currently being ignored with:

git status --ignored

And then find what gitignore is responsible with:

git check-ignore -v bin

That last command may or may not work on windows.

jonchurch avatar May 06 '20 20:05 jonchurch