How to run npm install on github - github

I would like to run npm install on GitHub. I tried doing so by cloning the repository through GitHub Desktop, but nothing happens on the online copy of the repo when I commit the changes.
I am trying to do this for parse-server.

If you want to commit npm packges (it's not advised to do so though), remove /node_modules from your .gitignore file.

Related

Update to BitBucket getting ECMDERR Failed to execute "git ls-remote --tags --heads git#github.com:MyProject/MyRepo.git"

My company has updated from GitHub to BitBucket, I have to update a legacy product that used links to many different dependencies. When I try to run
bower install
I get the following error: ECMDERR Failed to execute "git ls-remote --tags --heads git#github.com:MyProject/MyRepo.git"
The problem is I cant find a reference to that link anywhere in the code. I have updated all the Bower.json's that are used to use the new BitBucket links, yet i get this error anyways.
I have tried updating all my package.json's and bower.json's
I have tried bower cache clean
I have tried deleting node_modules folders and running npm i
and this error persists
Apparently Bower doesn't pull the master branch, it pulls the latest release. so I had to bump up the "Version" in the bower.json and package.json and set that as the newest release on bitbucket

Publish npm package project directly to github repository

Please note, i'm new to npm package manager.
I've created a simple bootstrap 4 sass+gulp starter project using npm package commands and scripts. Now i want to publish this project in a new github repository. I understand i can manually create a github repo, copy my project files and commit.
However, im curious
- to learn the better workflow / approach.
- Is there any npm tool /workflow for any github integration, for publishing?
- Is that the better approach first to create the github repository for any such project? clone then do other stuffs?
This time its only the artifacts. But, latter it might be a project with source where the project dependent artifacts will hold in npm package manager. However, i also noticed that lots of artifacts available in npm packages also has a github repo.
Git Commit
git add -A . && git commit -a -m 'gh-pages update'
Publish to Git
git push origin gh-pages --force && git checkout master
Make sure you're inside the folder of the package you need to publish onto Github for all the commands to work.
Publish to NPM
(Just in case)
Make sure you have name and package entries in your package.json file, then:
npm adduser
Verify that your user is set properly by running npm config ls finally npm publish should do the trick

host github pages from /dist folder in master branch

I was trying to publish my -username-.github.io repository to github pages but my index.html is inside dist folder.
I cannot use git subtree push --prefix dist origin gh-pages because this is meant for project pages, not user/org pages.
All I want is, github to treat dist as root directory for hosting user/org page. Please help.Thanks
PS: I don't want to do redirection hack.
Configuring a publishing source for GitHub Pages (very limited)
While you can select a folder as the source for gh-pages, you can only do so for the /docs directory at the parent level, and you still have to actually commit the built files in order to do so, which means you'll have to override the .gitignore and commit them twice
Automated Deploy Scripts
If you're using npm, there are a couple packages that handle publishing sub-directories to gh-pages. Install with option --save-dev to add it to your devDependencies:
push-dir
# install
$ npm install push-dir --save-dev
# usage
$ push-dir --dir=dist --branch=gh-pages
gh-pages
# install
$ npm install gh-pages --save-dev
# usage
$ gh-pages -d dist
In either case, if get a command line tool working for you and get it configured with the right options, you can alias it in your package.json like this:
"scripts": {
"deploy": "npm run build && gh-pages -d dist"
}
Further Reading:
Deploying a subfolder to GitHub Pages
Deploy Vue to GitHub pages-the easy way!
You can't do it this way.
GitHub pages can be hosted from either:
the / folder in the master branch
the / folder in the gh-pages branch
the /docs folder in the master branch
But the user pages must be built from the / folder in the master branch.
TIP
Code on another branch than the master. After every push to this branch, build it in any CI/CD tool and push it back to the master branch.
If like me you would prefer to upload to github pages using subtree's in git you can use something like the code below.
git subtree push --prefix dist origin gh-pages

If I create a git repo on github, does it automatically become a npm package?

Question1:
If I create a git repo on github, does it automatically become a npm package?
Question2:
If I publish a public NPM package, does it automatically shows up on github?

I want to put a new project on Github

I have a java/GWT project in eclipse , There is a Git repo git#github.com:example/example.git
where i want to put my complete project for the first time
Please guide me how can i do this , I am new to Github
I have searched a lot ,but couldn't able to do it successfully
I do have GIT Bash and GIT GUI
Thanks
Note that instead of having a msysgit installation (git bash and git gui), you could install on Windows the new windows.guthub.com:
That will facilitate cloning that repo.
The other alternative is to declate and clone it through Egit within Git, as described in this tutorial: Using Egit with GitHub.
Note that Eclipse+Egit means you don't have to install a msysgit (it is still recommended though, to benefit from the rich CLI of git outside Eclipse).
Follow the setup and create a repo instructions on github itself.
Basically you're going to do the following:
Install git on your development pc.
git init to create a local git repository for your project.
git add your files to the local repository.
git commit changes to the local repository.
git push to the remote github server when necessary.
Search Stack Overflow - try this post for starters: Git for beginners: The definitive practical guide