npm WARN deprecated npmconf@2.1.2: this package ha

2019-03-22 22:41发布

问题:

I am installing node.js on a CentOS 7 server, and am getting the following error when I try to install yeoman:

npm WARN deprecated npmconf@2.1.2: this package has been  
reintegrated into npm and is now out of date with respect to npm

The install of yeoman seems to otherwise work correctly. Is there something that I can do to avoid this warning? What are the implications of leaving it unhandled?

Here is the rest of the first part of the terminal output from the yeoman install:

[root@localhost ~]# npm install -g yo
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/usr/bin/yo -> /usr/lib/node_modules/yo/lib/cli.js

> yo@1.6.0 postinstall /usr/lib/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version
Everything looks all right!
/usr/lib
.... many lines of directory structure follow

回答1:

The problem is that the version of npm that is bundled with the "latest stable" version of node does not properly install some of our npm packages. To fix this, open a command prompt and run:

npm -g install npm

To update npm to the latest version. This should fix the problem.