npm git private repo auth

Our enterprise Github recently made a change so all anonymous access from work laptop are blocked. This causes problem as we have some private repo dependencies in our package.json like below: dependencies { … “sun”: “git+https://github.kdc.capitalone.com/NeX/sun-ng2-nex.git”, … } Whenever I try to do npm install, it gives me authentication error. I can get it installed…

package json bin field

We can define some executable js file in the bin section of the package json so that during installation, npm will symlink that file into prefix/bin for global installs, or ./node_modules/.bin/ for local installs. The file js need to start with the node flavor hash ban : #!/usr/bin/env node,  where the env will file the path of node in the system for us. And npm…

npm dev dependency not installed

When running npm install, the dev dependencies are usually also get installed. However today, we have a build runs inside a docker container which requires a test result to be generated and we cannot get test run. Turns out the Karma packages in the dev dependencies are not installed. The reason is the container in which…

dependencies resolve difference between yarn and npm

Today we found an interesting behavior difference between yarn and npm when resolving/placing dependency on node_module folder. It happens when i was help one of my teammates setting up a local debugging server which has a require on Library A. In our package.json, we do not have an explicit declaration on A. We have 2 depedencies B and C both have…

How bower works.

When I first looked into Bower, I wasn’t exactly sure how it fit in: it wasn’t just a JavaScript package manager, like Jam, and it wasn’t a module loader, like RequireJS. It calls itself a browser package manager, but what exactly does this mean? How’s that different from a JavaScript package manager? The main difference…

set up node js

Was playing around with node today, some notes for setting up. To install node, just go to the nodejs site and download. To run sample from the node site, create the something like yourapp.js file with the content they provide, open cmd or your terminal, navigate to the folder containing the js file. and run…