Npm install git https address but it looks for SSH instead - node.js

Hi I am looking for some help on installing private in-house npm modules in a Node project.
I just started writing a node library which I can install by specifying its git's url.
The problem I have is: I specified the dependency let say sample_module:
git+https://{token}:x-oauth-basic#github.com:{repo_org/repo_name}
However when I do npm install, it installs via ssh.
I want to use https only because of certain rules in collaboration. May I know if I could know why even if I specify https in the module url, it still goes to ssh protocol? How should I force or change it to HTTPS only?
Thank you!

I think your sample_module is set up to also support ssh, note the git in git+https://
Try setting the remote url as https://{token}:x-oauth-basic#github.com:{repo_org/repo_name} to see if it helps to default the behavior to use just https.
See https://help.github.com/articles/changing-a-remote-s-url/

Related

How can I use a custom version of a npm package in my project?

I use Primus in my project. Primus is a wrapper for websockets libraries like sockjs, which I use.
At server boot, primus creates a script, that will then be downloaded by our client, as the client part of the socket. This script embeds the source code of sockjs. Problem, it uses the 1.1.2 version of sockjs, that contains a bug, fixed in version 1.1.4, but not in Primus yet.
I asked the maintainers of Primus to change it but the are too slow to do it.
So I forked Primus, and I replaced the wrong file by the good one.
Now, I want to use this package instead of the wrong one, declared currently in my package.json.
I don't know what the good practice is in this case, the only solution I can think is to npm-publish my modified package under a different name, like amplement-primus, and then do npm install --save amplement-primus to insert it in my project. I have no idea of it breaks a rule of npm.
Do you think it's a good idea, or do you have something better in mind ?
Thank you !
I used the github url of the project to reference it in package.json:
"dependencies": {
"primus": "git+https://github.com/amplement/primus.git",
"sockjs": "^0.3.19"
},
You can use forked repo to install the package.
like :
npm install github_url_of_your_repo
For more details:
See this.

Secure Gateway client not starting on Linux

I have installed the Secure Gateway client (v1.4.2) on RHEL V7. When I attempt to start the client, I receive an error that log4js cannot be found. I am trying to find out where log4js should reside.
enter image description here
Additional information:
Installation was done as follows:
rpm -ivhf ibm_securegateway_client_1.4.2_x86_64.rpm --force
Hardware: Intel (not AMD)
The installation log indicated that the install was successful.
Please add --force option on Redhat Version 7.
rpm -ivhf --force ibm-securegateway-client-1.4.2+client_amd64.rpm
It looks like your node modules did not install correctly. Please ensure you have the correct permissions and reinstall so the node modules can be correctly added.
On a side note, you may encounter issues when attempting to start the client from outside the client directory due to how it searches for the associated files.

How do you use tfs-cli in a disabled network environment?

Our TFS build server does not have access to the internet. After getting node.js installed next I tried to install tfx-cli. using the command:
npm install -g tfx-cli
As far as I can tell, now it wants to download dependencies required. It looks like a whole web of dependencies - nuget style. Am I expected to set up an internal npm server with the dozens of dependencies required, becoming an expert on node.js and npm - just so I can add some custom commands to our TFS server?
Is there a version of tfs-cli I can get that includes all dependencies ?
I know this is old, but I just happened to come across your question. Hopefully this will help others.
Although I haven't tried it myself, there do seem to be ways of installing NPM packages offline. Here's one Stack Overflow answer that may get you pointed in the right direction. Another solution I've seen recommended is npmbox.

How to add an accounts-password package?

My platform is windows 7.I want to add the accounts-password package. But I got a "error:CERT_UNTRUSTED".
This is all output error message.
AppData\Local.meteor\leaderboard>..\meteor add accounts-password
Unable to update package catalog (are you offline?)
If you are using Meteor behind a proxy, set HTTP_PROXY and HTTPS_PROXY
environment variables or see this page for more details:
https://github.com/meteor/meteor/wiki/Using-Meteor-behind-a-proxy
=> Errors while adding packages:
While downloading npm-bcrypt#0.7.8_2...: error: CERT_UNTRUSTED
Your package catalog may be out of date. Please connect to the
internet and try again.
Blockquote
I don't know how to fix this problem. Or is there a alternative manual way to add this accounts-password package. Have any suggestions? Many thanks.
You have a space in "pa ssword".
Run:
meteor add accounts-password
You'll be good to go.
It looks like you are behind the firewall which is conducting SSL Inspection (so it is replacing SSL certificate). If it is so - ask your system administrator to turn off SSL Inspection for your machine and try again.

broccoli-closure-compiler install error

I am trying to test es-6 promise-polyfill, for the testing one the node packages requried is broccoli-closure-compiler, which is not getting installed, I am behind a proxy server, is that the problem, but i have proxy config for both git and npm, so they are working fine, for more info, please refer to the screenshot of the command prompt,
edit:
the text in screenshot
D:\pt>npm install broccoli-closure-compiler
npm WARN package.json jshint#0.9.1 No repository field.
\
closurecompiler#1.3.2 install D:\pt\node_modules\broccoli-closure-compiler\node_modules\closurecompiler
npm run-script configure
\
closurecompiler#1.3.2 configure D:\pt\node_modules\broccoli-closure-compiler\node_modules\closurecompiler
node scripts/configure.js
Configuring ClosureCompiler.js 1.3.2 ...
Downloading http://dl.google.com/closure-compiler/compiler-latest.tar.gz ...
? Download failed: Error: connect ETIMEDOUT
? Unfortunately, ClosureCompiler.js could not be configured.
See: https://github.com/dcodeIO/ClosureCompiler.js (create an issue maybe)
what I am suggesting is not a solution, these are mere work-around( aka really bad hacks)
if you are facing this, it is because you are behind a proxy server and one of the scripts trying to install clousurecompiler does not have the proxy settings set.
work around one : well, find a way to connect without proxy server, or install in a machine outside proxy server, copy the node_module files to your system,
work around 2 (the one I used) :
when you look at the screenshot, you would notice that at one point "node scripts/configure.js" is run, this is the crucial point, find a way to pause the processing just before this point,
open the 'configure.js' file, it would be at '.\node_modules\broccoli-closure-compiler\node_modules\closurecompiler\scripts' in node project directory,
comment line 65 in that i.e fail(); to //fail();
continue the installation process,
manually download http://dl.google.com/closure-compiler/compiler-latest.tar.gz , put the extracted file at '.\node_modules\broccoli-closure-compiler\node_modules\closurecompiler\compiler' in your project directory
(... told you this is a bad solution )

Resources