I probably missed something here. I'm using Node 0.10.1 on Win7/64bit and installed grunt 0.4.1 with
npm install grunt
npm install -g grunt-cli
npm install -g grunt-init
Then I tried to install a template while in folder %USERPROFILE%
git clone git#github.com:gruntjs/grunt-init-gruntfile.git ~/.grunt-init/gruntfile
But git wants a passphrase for key [current folder]. So I just created a folder
%USERPROFILE%\.grunt-init\gruntfile\
and copied
https://raw.github.com/gruntjs/grunt-init-gruntfile/master/template.js
to it. Now I switched to the project folder and was able to start grunt-init with
grunt-init gruntfile
DOM involved? n
files concatenated or minified? Y
package.json? n
any changes? N
Process ends with "Done, without errors", but no file ist created, or at least I can't find it.
dont know how to clone into your userhome on windows, but IMPORTANT(!) you also need to copy the whole "root" directory ( https://raw.github.com/gruntjs/grunt-init-gruntfile/master/root) to '%USERPROFILE%.grunt-init\gruntfile\'
you know that this init-template will just create a gruntfile.js for you? (inside the root-directory you can see that). if you want to create a node-module, jquery-plugin and so on, use one of the other templates (grunt-init-node, grunt-init-jquery) and so on.
creating your own template is easy. just create a new folder in '%USERPROFILE%.grunt-init' with your template-name. add the template.js. add a root-directory where all the files are which you want to be copied, maybe add a rename.json (for folder and file-renamings) and maybe change some stuff in the template.js.
I think you are have few a different issues here - from your comments it looks like you are using a Windows.
The first issue is that you can't clone the repository. Having tried this myself, I found the problem was fixed by setting up a valid ssh key on my github account. So to clone this repository you need to create a github account and install ssh keys on both your machine and your github account. Github's documentation on how to do this is very good and can be found here for Windows https://help.github.com/articles/set-up-git#platform-windows.
The second issue is that the git clone command you are using won't work on a Windows machine as it supplies a path to a Linux home directory ~/.grunt-init/gruntfile.
From your comments I am guessing the %USERPROFILE%.grunt-init\gruntfile\ is the correct install directory for Windows and so changing your working directory to that and using the command git clone git#github.com:gruntjs/grunt-init-gruntfile.git should install it.
You may also consider working using Cygwin which allows you to use a linux working environment on a windows machine.
Happy node hacking.
Related
I install the Apache Maven on Ubuntu server with Apt with sudo apt install maven
I am new to Linux but as I am understanding this installation produces an m2 repository.
what is want is the following:
first how to find and inspect this m2?
second how to replace this m2 with an m2 repository that I have download to my desktop?
By default, maven's local repository is located in the user's home directory. In fact it's actually named ".m2" directory, instead of just "m2". It is a hidden directory. If you are not in your home directory, issue "cd ~" first. Then issue "ls -al" to see the presence of .m2 directory.
If for any reason, you do not see that "m2" directory after issuing above command, it simply means that you did not built or run any project that requires maven to get triggered and create that .m2 folder.
ps: Replacing the existing .m2 folder with the one you have on your desktop may not be a good idea. Instead, simply run the project (that you think requires the needed dependencies). This will build the .m2 directory afresh along with everything that app needs.
I am new to git and i want to know how to use git repo. generally developers created for use our own.
jus like i want to use any node.js example code : Git Repo Link and i have clone it by git-bash also i have download the .zip file in my local computer. but dont know what is the next step to make it runnable. i want to learn from the code people done on git. i have run
npm install
and after downloading all dependencies in
node_modules
directory. but dont know what is the next process and how to analyse repo to make it work in local. please help.
From the wording in your question, it sounds like you may be confused between git and npm etc.
Git is a source control tool that is able to remotely/locally sync versioned files(changes).
Take a look at the following doc to learn about setting up a new git repo locally without a remote repo setup.
https://git-scm.com/docs/git-init
NPM is a package manager for Node.JS
http://npmjs.com/
To see what others are doing with Git, go take a look at these and clone some: https://github.com/trending
please run below command
git clone https://github.com/lmammino/judo-heroes.git
After that run
npm install
We have a Jenkins Build server running on Ubuntu 14.04 x64 which is processing three other projects just dandy. We are integrating a fourth Node.js project but due to fact the outside contractor developing it put all the project files inside a folder of the repository. So to clarify, the root of the repository is a single folder; in which the actual project root is located.
Jenkins checks the repository out but when it runs the NPM commands for install and build fails as its looking for the package.json in the repository root versus the subfolder where all the necessary files are located.
There is lots of information out there on use case which have some similarities as mine, but nothing which provided a solution which worked for me.
I've tried using the full path when executing the shells commands, altering the projects workspace to the subfolder, even researched a way to checkout the specific folder using Git which appears to not be a trivial thing.
I cannot believe there isn't a way to execute a Jenkins build into the checkout repositories as if a specific subfolder was the root (CWD) for all the scripts being executed in the shell instance.
Any help would be greatly appreciated!!!
As hinted in the comment, the solution is to cd into the subfolder before the calls to npm.
Im working on a project that requires bower components from Git and its not being installed even after i having GIT in my system. I have also set the path to git/cmd.
The configs are : Windows7; GIT is 2.7.0.windows1 and the Path is programfiles/git/cmd
I have also tried the various solutions given here in Stackoverflow but nothing solved my problem. One interesting observation i made is there was no git in user/appdata
npm is also installed in the system. Kindly suggest me a solution to this issue.
git not in the path
,
the git terminal
Bower clearly states in its "Windows Users" section:
To use Bower on Windows, you must install Git for Windows correctly. Be sure to check the options shown below:
This issue confirms it:
I've encountered the same issue before,
I just re-install everything and followed these instructions.
Firstly I installed Git then install bower , it fixes my problem.
Or, at the very least, before your bower command:
set PATH=%PATH%;C:\Program Files (x86)\Git\bin;
I just encountered the same problem.. and after searching and trying out some answers given by many here in stackoverflow and youtube.. this one thing worked for me on windows..
I reinstalled Git.. then..check the third option
after installing.. right click on your project folder and select "Git Bash Here".. and it worked like a charm..
check also with window cmd.. and it finds Git PATH..
hope this helps.
I'm trying to "portablize" git, so I want to send the required executables from the make process of git to my hosted web server. Can I do that? Do you think the executables will work?
The way I do it is to:
get all Git dependencies (as listed in this Solaris package site, but this works for any Unix platform)
compile those dependencies with --prefix=/home/myuser and install them in the usr/local/lib of my home directory
then compile Git (still avoiding any reference to a system path like /usr/local/lib, but only using the lib and include within my homedir)
and install Git in the /home/myuser/git directory
I can then copy only /home/myuser/git and /home/myuser/usr/local (and $prefix/libexec/git-core as Jakub mentions in the comments) to any other similar server, knowing it will work in isolation from any existing system libraries.