如何避免" npm获取GET 200"在npm 5中调用install时的日志

时间:2017-08-21 14:45:14

标签: node.js npm

自从升级到npm 5以来,尽管设置了npm fetch GET 200 ...,但我在构建服务器上收到了大量npm config set loglevel warn条消息(见下文)。那有新的设置吗?

[0m[91mnpm info[0m[91m config[0m[91m set "loglevel" "warn"
[0m[91mnpm info [0m[91mok 
[0m[91mnpm[0m[91m info it worked if it ends with ok
[0m[91mnpm info using npm@5.3.0
npm info using node@v8.3.0
[0m[91mnpm info lifecycle myapp-client@0.0.1~preinstall: myapp-client@0.0.1
[0m[91mnpm http fetch GET 200 https://registry.npmjs.org/babel-eslint 98ms
[0m[91mnpm http fetch GET 200 https://registry.npmjs.org/babel-eslint/-/babel-eslint-7.2.3.tgz 23ms
[...]

1 个答案:

答案 0 :(得分:2)

带节点的Docker容器通常将ENV变量NPM_CONFIG_LOGLEVEL设置为info而不是默认warn。您可以自己设置此ENV var或使用npm install --logLevel warn覆盖该行为。