如何在zsh中抑制npm / nvm的弃用警告?

问题描述 投票:0回答:1

我使用nvm来管理节点版本。我已经通过zsh-nvm将它作为插件安装到zsh。我已经安装了两个版本的节点--v6.1.0和v.0.10.42。由于我正在开发一个使用后者的项目,因此我将其设置为默认项目。现在,每次打开终端窗口时,都会收到以下警告:

npm WARN deprecated This version of npm lacks support for important features,
npm WARN deprecated such as scoped packages, offered by the primary npm
npm WARN deprecated registry. Consider upgrading to at least npm@2, if not the
npm WARN deprecated latest stable version. To upgrade to npm@2, run:
npm WARN deprecated 
npm WARN deprecated   npm -g install npm@latest-2
npm WARN deprecated 
npm WARN deprecated To upgrade to the latest stable version, run:
npm WARN deprecated 
npm WARN deprecated   npm -g install npm@latest
npm WARN deprecated 
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated 
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.

我尝试添加一个~/.npmrc文件,其中我放了loglevel="error",但我仍然得到这些警告。我想我需要在我的.zshrc文件中加入一些设置。你能指点我哪一个吗?

node.js npm
1个回答
0
投票

据我所知,抑制这些警告(从npm)的唯一方法是使用不发出它们的npm版本。

© www.soinside.com 2019 - 2024. All rights reserved.