38

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?

A-Sharabiani
  • 17,750
  • 17
  • 113
  • 128
Felix_Billon
  • 690
  • 2
  • 10
  • 21

3 Answers3

78

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.

Sam Mikes
  • 10,438
  • 3
  • 42
  • 47
  • Thanks for your help. I aim to hide this warn, cause TFS interpret this as an error. – Felix_Billon Dec 30 '14 at 13:13
  • 3
    OK, well somewhere in one of your TFS scripts, something is running an `npm install`. you need to change that to `npm --logevel=error install`, and that will suppress the WARN message and Team Foundation Server will stop complaining about it. – Sam Mikes Dec 31 '14 at 15:14
  • After waiting on angular 4 to install for an hour, I cancelled it, used this parameter, and it installed in about 10 seconds. – omikes Mar 21 '18 at 19:16
14

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

npm install --silent

npm docs

Alynva
  • 499
  • 7
  • 10
5

npm install --no-optional prevents this warning

Paolo
  • 20,112
  • 21
  • 72
  • 113
Angus
  • 349
  • 3
  • 10