2016-02-19 68 views

回答

1

我相信Gradle Node Plugin自己執行npm來解析模塊,所以只需更新.npmrcregistry=https://npm.yourcompany.com就可以工作。

請注意,這基本上是npm config set registry所做的,正如RaGe在他的評論中所建議的那樣。

+0

npmrc應該在哪裏與項目相關或者爲gradle節點插件的npm構建來使用它? – Jake

+0

IIRC它應該是'package.json'的兄弟 –

0

如果你想直接在gradle這個任務,爲此,您可以使用以下方法:

task setregistry(type: NpmTask) { 
    args = ['config', 'set', '@scope:registry', 'https://npm.registry.company.com'] 
} 

task setregistry(type: NpmTask) { 
    args = ['config', 'set', 'registry', 'https://npm.registry.company.com'] 
} 

您還可以,如果你想設置特定範圍註冊表做到這一點