npm install: WARN on dependency

2020-03-01 05:09发布

问题:

I'm using npm install cmd in my TFS build. I always get the following WARN:

npm WARN optional dep failed, continuing fsevents@0.3.1

How could I delete this warning?

回答1:

Are you running on Windows or Linux? If so, fsevents cannot be installed, as it is an OSX-only package.

If you run npm with --loglevel=error, you should no longer see this or any other warnings. As far as I know, there is no way to selectively suppress warnings in npm.



回答2:

The flag -s / --silent works good if you want to remove all warnings and errors:

npm install --silent

npm docs



回答3:

npm install --no-optional prevents this warning