gradle-node-plugin
gradle-node-plugin copied to clipboard
Please provide examples on how to provide configuration properties
I'd like to provide configuration to properties.
Invoking this from the commmand line works fine:
npm config set registry https://registry.npmjs.org
npm config set strict-ssl false
When I try to provide it in npm_task:
task setRegistry(type: NpmTask) {
//Set NPM Registry
args = ['config', 'set', 'registry', 'https://registry.npmjs.org']
}
I get following error:
Specify configs in the ini-formatted file:
/user/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
so it is possible to pass values in npm <command> --key value
fashion, but neither args = ['config', 'set', '--registry', 'https://registry.npmjs.org']
nor args = ['config', 'set', '--registry https://registry.npmjs.org']
works.
Could you please provide information in documentation on how to do it correctly?
Facing same problem, curious if anyone has found a way to do this?
@jgriff use .npmrc
files instead: https://docs.npmjs.com/files/npmrc
@web-devel so every developer in project must create this file?
@eximius313 you can place .npmrc
in the root of your project and commit it (obviously you should not commit any auth info)
I too am looking for a way to set the npm registry, but creating a .npmrc
file doesn't make sense in my case. I am not creating my own Node project, I'm just using npm to download scripts/tools that I use during my build for validation purposes. I don't have anywhere to put a .npmrc
file.
So how else can this be accomplished?