Skip to content
Advertisement

Tag: npm

Is it possible to override a local .npmrc when running `npm install`?

My project has an .npmrc located in its root, which contains the infamous ${NPM_TOKEN} hack and is required for CI, Staging, Production, etc. In order to work around this reality, I’d like for developers to be able to tell npm to use an alternative .npmrc, which contains their _authToken, when installing dependencies. Something like, npm install . –npmrc=~/.npmrc. This would

Is it possible to set the root directory of a node module?

If I publish a node module with source files in a src directory, and people would like to import a file in their project, they would need to specify the full path from the module. Example: Structure: package.json: Implementation: (or using require) Is there any way to set up the package so that it knows src is my sources root,

Running npm globally installed packages

Can someone please explain how do node’s globally installed behave. It is really confusing me. If I install a package (with executables) such as http-serverglobally I can run it with: But if I do I get I suspect my ternpackage in emacs is trying to run it with node hence breaking. Why is this happening? Why can’t node find the

What is “entry point” in npm init

I have an empty new project, when i run npm init i got a list of questions to answer, for example: I am really confused about the one that says “entry point”, Should this be my index.html file or my app.js or is it something else? Answer Quoting from this blog post: Entry point is the javascript file that will

jshint Error: Cannot find module ‘underscore’

My grunt task seems to be running perfectly fine, but every time I run it I’m getting this error: Is there any way to find out why this is happening? I can see the /grunt-contrib-jshint directory is in the /node_modules directory. Is there any reason it can’t find the underscore module? I’ve tried running npm install but I still get

Sending command line arguments to npm script

The scripts portion of my package.json currently looks like this: …which means I can run npm start to start the server. So far so good. However, I would like to be able to run something like npm start 8080 and have the argument(s) passed to script.js (e.g. npm start 8080 => node ./script.js server 8080). Is this possible? Answer npm

Advertisement