I'd like to install node modules from our gitlab server. This is a link to a repository:
http://ABCD-GITLAB/myGroup/myNodeModule.git
According to the npm install guide the install command should be this:
gitlabUser: me
myProject: myNodeModule
npm install gitlab:mygitlabuser/myproject
I have no idea how to reference my
gitlab server url
group
project
account name
I tried some commands but all failed:
npm install gitlab:ABCD-GITLAB:me/myproject
npm install gitlab:ABCD-GITLAB:me/myproject.git
npm install gitlab:http://ABCD-GITLAB:me/myproject
npm install gitlab:http://ABCD-GITLAB:me/myproject.git
npm install gitlab:http://ABCD-GITLAB:me/myGroup/myproject
npm install gitlab:http://ABCD-GITLAB:me/myGroup/myproject.git
npm install gitlab:http://ABCD-GITLAB:me/myGroup/myproject.git
What is the correct way to reference a npm dependency, a clear structure would be great like
npm install gitlab:<serverUrl/>:<username/>/<groupname/>/<projectname/><gitsuffix>.git
I would try one of these:
npm install git+ssh://git#ABCD-GITLAB:myGroup/myNodeModule.git
npm install git+https://git#ABCD-GITLAB/myGroup/myNodeModule.git
npm install git://ABCD-GITLAB/myGroup/myNodeModule.git
You may need to change git to your username and you can add #v1.0.27 or something like that at the end for a specific version or tag:
npm install git://ABCD-GITLAB/myGroup/myNodeModule.git#v1.0.27
You can also install from a tarball:
npm install https://ABCD-GITLAB:myGroup/myNodeModule/repository/archive.tar.gz
You can add ?ref=master to the end of the tarball URL for the branch.
Related
I have git project downloaded in dir d:/myapp. I have npm 3.10.10 and node 6.11 install on my windows machine. But while runnning Install npm from git bash commd line to install all dependent node module...i get error as below:
$ install npm
install: missing destination file operand after 'npm'
Try 'install --help' for more information.
The command to install npm modules is just npm install. It looks you are doing install npm install, with an extra "install" before npm.
Here are the official docs for npm install showing the different options. Note that npm is always the first command for any npm commands, whether it's install, start, etc.
I am using the version of node that is stated on electron's site, which is 7.4.0 and I'm using NPM version 4.0.5 (Windows).
The problem I'm having is with the npm install command in the cloned electron-quick-start folder. I have tried using the command with --save-devand -g but they don't do anything to help.
Upon using just npm install;
fetchMetadeta: still install loadAllDepsIntoIdealTree
With the above stated arguments (output);
--electron-quick-start#1.0.0
Then npm start after the above output;
Pastebin
Any help would be greatly appreciated, thanks.
You must get npm install to work before you can start the app
You could try the following
npm cache clean
npm install This will cache clean of npm
npm install -g yarn
yarn install This will install yarn (This will probably work but it might not be what you're looking for). Yarn is an alternative to npm
npm -g install npm
npm install This will reinstall npm
And I would look into nvm and nvm-windows
And if none of those work I would look at
this issuse on github
And if that doesn't work I would just look at google
I can successfully
git clone https://[org].visualstudio.com/_git/[repo]
but if I run
npm install https://[org].visualstudio.com/_git/[repo] --save
I get
npm ERR! fetch failed https://[org].visualstudio.com/_git/[repo]
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 203
Is it possible to install npm packages from Team Services git repos like you can from github?
If you want to install a package from a specific Git repo you need to structure the URL as follows, notice that the url is prepended with git+https://
npm i --save git+https://[org].visualstudio.com/_git/[repo]
This will also work if you want to install your repo over ssh
npm i --save git+ssh://git#github.com:<owner>/<repo>
You can add these style repo URL's to your package.json dependencies as well
"dependencies": {
"custom-pkg": "git+https://[org].visualstudio.com/_git/[repo]"
}
You can read more about the different ways to install directly from git with npm in the npm install docs
If you want to install a specific branch, you can run:
npm install git+https://[org]#dev.azure.com/[org]/Products/_git/[repo]#[branch]
I had install Node.js 4.2.2
i am trying to install socket.io package using npm install socket.io
but the npm installer just keep running with no error output in console after 30min..
Try to install some another package, mongoose for example. If it also fails try to reinstall npm by
npm install -g npm
Try the following:
npm install -g npm
npm cache clean
npm install socket.io
Also check if you permission to create node_modules folder in the directory you run npm.
You can downgrade your nodejs to v.4.2.1 for example, don't forget to clean npm cache after that, and then run npm install command.
First try to remove these packages and then install. Like
npm remove socket.io
Then
npm install socket.io
may be the incomplete installed files are blocking it to install properly
You need to update your npm anyway.
Try from link install:
curl -L https://www.npmjs.com/install.sh | sh
Or you can compile it with make if you clone sources from github
npm install downloads packages from npmjs.org, compiles and then installs. So even if the node_modules folder is taken backup it can not be used on other machines where the os might be different, due to the native machine code generated during the npm install.
Also another problem with npm install is that it downloads from npmjs.org. What if the site goes down?. How to download the packages and the same package be installed offline on all platforms?
You can tell npm to use a mirror if npmjs.org is down. For example:
npm set registry http://registry.npmjs.eu/
Or with a runtime option:
npm --registry http://registry.npmjs.eu/ install express
If you do keep the node_modules directory with your code, you can simply run npm rebuild to re-compile anything that needs it.
Otherwise, you have a lot of options for installing from various locations. You could keep package tarballs locally. From the documentation:
npm install (with no args in a package dir)
npm install <tarball file>
npm install <tarball url>
npm install <folder>
npm install [#<scope>/]<name> [--save|--save-dev|--save-optional] [--save-exact]
npm install [#<scope>/]<name>#<tag>
npm install [#<scope>/]<name>#<version>
npm install [#<scope>/]<name>#<version range>
npm i (with any of the previous argument usage)