Skip to content
This repository has been archived by the owner. It is now read-only.

NPM 3.10.8 tries to install optional dep on unsupported platform when using npm-shrinkwrap.json #14042

Closed
paglias opened this issue Sep 22, 2016 · 81 comments

Comments

@paglias
Copy link

commented Sep 22, 2016

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • Other (see below for feature requests):

What's going wrong?

This problem started appearing with NPM 3.10.8, with 3.10.7 it worked well. With 3.10.8 TravisCI tries to install fsevents which is an optional dependency of a dev dependency that only works on OS X / mac OS and so it fails.

matteo@macbook~/dev/habitrpg/habitrpg$ npm ls fsevents
habitica@3.42.1 /Users/matteo/dev/habitrpg/habitrpg
└─┬ karma@1.3.0
  └─┬ chokidar@1.6.0
    └── fsevents@1.0.14

If it can help we're using npm shrinkwrap where the package is listed as optional: true

"fsevents": {
  "version": "1.0.14",
  "from": "fsevents@>=1.0.0 <2.0.0",
  "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.0.14.tgz",
  "optional": true,
  "dependencies": {
    ...
  }
},

An example of a failing build is https://travis-ci.org/HabitRPG/habitrpg/builds/161951399, I don't have access to npm-debug.log

npm ERR! Linux 3.13.0-92-generic
npm ERR! argv "/home/travis/.nvm/versions/node/v4.3.1/bin/node" "/home/travis/.nvm/versions/node/v4.3.1/bin/npm" "install"
npm ERR! node v4.3.1
npm ERR! npm  v3.10.8
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64
npm ERR! Please include the following file with any support request:
npm ERR!     /home/travis/build/HabitRPG/habitrpg/npm-debug.log

@paglias

This comment has been minimized.

Copy link
Author

commented Sep 22, 2016

Just verified that this is happening on our production server that runs Linux.

@paglias paglias changed the title NPM 3.10.8 broke our TravisCI build NPM 3.10.8 tries to install optional dep on unsupported platform Sep 22, 2016

@paglias

This comment has been minimized.

Copy link
Author

commented Sep 22, 2016

Some more info, I created the shrinkwrap file with npm shrinkwrap (no options) with a just installed node_modules folder on mac OS using npm 3.10.8

According to npm ls fsevents it's a dependency of a dev dep (karma) that isn't included in the shrinkwrap so I'm also wondering why fsevents was added at all

@paglias paglias changed the title NPM 3.10.8 tries to install optional dep on unsupported platform NPM 3.10.8 tries to install optional dep on unsupported platform when using npm-shrinkwrap.json Sep 22, 2016

@paglias

This comment has been minimized.

Copy link
Author

commented Sep 22, 2016

Just tried a 100% exactly build but without the npm-shrinkwrap.json file and it works so the problem seems to be with it https://travis-ci.org/HabitRPG/habitrpg/builds/161957509

@chodorowicz

This comment has been minimized.

Copy link

commented Sep 23, 2016

Exactly same situation here, builds failing in Heroku because of fsevents being dependency of dev browser-sync
npm ERR! notsup Unsupported platform for fsevents@1.0.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
Downgrading to npm 3.10.7 solves the issue.

@sebreh

This comment has been minimized.

Copy link

commented Sep 23, 2016

We are seeing the same issue. Like @chodorowicz mentioned, downgrading to 3.10.7 works.

@psylence303

This comment has been minimized.

Copy link

commented Sep 23, 2016

Also happens for us, we had to downgrade to 3.10.7

@paglias

This comment has been minimized.

Copy link
Author

commented Sep 23, 2016

For now we've been generating npm-shrinkwrap.json on Linux and it works
with 3.10.8 but would like to have a lasting solution

Il 23 set 2016 11:13, "Artem Levik" notifications@github.com ha scritto:

Also happens for us, we had to downgrade to 3.10.7


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#14042 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAkAV80ObHeIPXPqp4EGohPNeh5eHYtCks5qs5gsgaJpZM4KEE5i
.

@zdavis

This comment has been minimized.

Copy link

commented Sep 26, 2016

We're seeing this as well in our Travis builds.

zdavis added a commit to ManifoldScholar/manifold that referenced this issue Sep 26, 2016
[C] Specify travis NPM version
With NPM v3.10.8 optional dependencies specified in shrinkwrap are
installed even when they shouldn't be. This cause Karma installation to
fail on Travis servers, which in turn leads to failing builds. The issue
is tracked here: npm/npm#14042
@albertstill

This comment has been minimized.

Copy link

commented Sep 28, 2016

We also have this problem. At work we have Windows devs, Mac devs, CircleCI Linux, and AWS Linux. A hack fix for us is to manually delete fsevents (or what ever non-cross platform dep) from the shrinkwrap when we do an install on Mac.

I was hoping in 3.10.8 npm install would check if the optional shrinkwrap dep was compatible before installing. Because now the deps contain a optional boolean field. Much like an npm install works when there is no shrinkwrap, for example it checks the fsevents os field against the target OS.

However I understand there is an argument that this would be defeating the point of shrinkwrap if it's output varies depending on the target machine.

We are moving to Docker soon so this will problem will disappear for us. Interested to see what the solution is though.

@mfn

This comment has been minimized.

Copy link

commented Sep 28, 2016

FTR, having the same problem (duplicate reported at #14089 ) and our team needs to stay at 3.10.7 because of this.

albertzak added a commit to rslnd/rosalind that referenced this issue Oct 2, 2016
albertzak added a commit to rslnd/rosalind that referenced this issue Oct 2, 2016
@joefiorini

This comment has been minimized.

Copy link

commented Oct 5, 2016

I ran into this issue for fsevents as well, and it seems that adding:

  "optionalDependencies": {
    "fsevents": "*"
  },

to my project's package.json and then installing with --no-optional fixed it for me without downgrading to 3.10.7 (still on 3.10.8 on my server).

@bardiharborow

This comment has been minimized.

Copy link

commented Oct 10, 2016

Just hit this over at twbs/bootstrap. Exactly the same issue of shrinkwrapping on a mac and then installing on Travis.

twbs-savage pushed a commit to twbs-savage/bootstrap that referenced this issue Oct 10, 2016
@wavded

This comment has been minimized.

Copy link

commented Oct 10, 2016

Same. Downgrading to 3.10.7 fixed it for now.

hypery2k added a commit to holisticon/angularjs-common that referenced this issue Oct 11, 2016
mathiasbynens added a commit to jsperf/jsperf.com that referenced this issue Oct 13, 2016
contolini added a commit to cfpb/cfgov-refresh that referenced this issue Jan 31, 2017
lauraGgit added a commit to 18F/fedramp-dashboard that referenced this issue Feb 1, 2017
get rid of npm-shrinkwrap
To try to avoid the npm install issues on travis: npm/npm#14042
wmfgerrit pushed a commit to wikimedia/parsoid that referenced this issue Apr 5, 2017
Fix deps from db90842
 * There was bug in npm@3.10.8 that comes with node v6.9.1 that prevents
   omitting optional deps from the shrinkwrap, which we need to avoid
   the binary dep in dtrace-provider

 * This was done after upgrading to npm@3.10.10 -g

 * See npm/npm#14042

Change-Id: I9e60e8df999d0cd0786295274f427b1f964fa960
@bradchesney79

This comment has been minimized.

Copy link

commented Jun 21, 2017

--So, wouldn't the best fix be for Mac users to ask that this feature just works natively? The rest of us are incurring problems because we needed to add a work around for Mac users. You all realize this is a work around for a work around-- which to me seems silly-- and this has been in place a long time, Mac OS devs (the guys that actually work on the code that compiles to be the OS, mind you)... you're wearing egg all over your faces, you should get that off.

Just another example of why I feel Macs are the second best dev platform. Win machines a distant fourth or fifth...

@hieudang9

This comment has been minimized.

Copy link

commented Jun 30, 2017

Same Here

[~/upterm] : npm --version                                                                                           (master) 10:34:54
4.6.1
[~/upterm] : node --version                                                                                          (master) 11:22:43
v8.1.3
@mikeshow

This comment has been minimized.

Copy link

commented Jul 18, 2017

Same here:
npm 5.3.0
node 7.10.1

@carvalhoviniciusluiz

This comment has been minimized.

Copy link

commented Sep 21, 2017

hi!
i'm using node v8.5.0 with npm v5.4.2 in macOS Sierra v10.12.6

I got the error

$ npm install
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for inotify@1.4.2: wanted {"os":"linux","arch":"any"} (current: {"os":"darwin","arch":"x64"})
npm ERR! notsup Valid OS:    linux
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   darwin
npm ERR! notsup Actual Arch: x64

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/viniciuscarvalho/.npm/_logs/2017-09-21T01_39_04_629Z-debug.log

last lines of the log

8541 verbose unlock done using /Users/viniciuscarvalho/.npm/_locks/staging-155aa32e51b9d4ae.lock for /Users/viniciuscarvalho/Dropbox/server/node_modules/.staging
8542 verbose stack Error: Unsupported platform for inotify@1.4.2: wanted {"name":"inotify","version":"1.4.2","author":{"name":"Camilo Aguilar","email":"camilo.aguilar@gmail.com"},"email":"camilo.aguilar@gmail.com","keywords":["inotify","watch","monitor","watch files","watch directories"],"license":"MIT","description":"inotify bindings for v8 javascript engine","repository":{"type":"git","url":"git+ssh://git@github.com/c4milo/node-inotify.git"},"os":["linux"],"engines":{"node":">=0.8"},"main":"inotify","dependencies":{"bindings":"^1.2.1","nan":"^2.3.3"},"scripts":{"test":"node-gyp configure build","install":"node-gyp rebuild"},"gypfile":true,"contributors":[{"name":"Adrian Estrada","email":"edsadr@gmail.com"},{"name":"Alexander Makarenko","email":"estliberitas@gmail.com"},{"name":"Brian Ingalls","email":"bingalls@compete.com"},{"name":"Brian White","email":"mscdex@mscdex.net"},{"name":"Camilo Aguilar","email":"camilo.aguilar@gmail.com"},{"name":"Dan VerWeire","email":"dverweire@gmail.com"},{"name":"FrozenCow","email":"frozencow@gmail.com"},{"name":"Michael Boe","email":"mschuylerb@gmail.com"},{"name":"Yannick Croissant","email":"k1der.country@free.fr"},{"name":"ikokostya","email":"ikokostya@gmail.com"}],"bugs":{"url":"https://github.com/c4milo/node-inotify/issues"},"homepage":"https://github.com/c4milo/node-inotify#readme","_id":"inotify@1.4.2","bundleDependencies":false,"deprecated":false,"_resolved":"https://registry.npmjs.org/inotify/-/inotify-1.4.2.tgz","_integrity":"sha512-+dq8cO+Um/EiGujOilVGw1AclDq9V4B23z4I+PpytUlgIrWfOG/KxW4k7pRZwHHSoqUzlScCWYuQS8Wa+hYcXg==","_shasum":"fd69d0f6e4a55005e338b3c1852fbb81acfb3ccc","_from":"inotify@>= 0.1.6","_requested":{"type":"range","registry":true,"raw":"inotify@>= 0.1.6","name":"inotify","escapedName":"inotify","rawSpec":">= 0.1.6","saveSpec":null,"fetchSpec":">= 0.1.6"},"_spec":"inotify@>= 0.1.6","_where":"/Users/viniciuscarvalho/Dropbox/server/node_modules/dev"} (current: {"os":"darwin","cpu":"x64"})
8542 verbose stack     at checkPlatform (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/npm-install-checks/index.js:45:14)
8542 verbose stack     at tryCatcher (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
8542 verbose stack     at ret (eval at makeNodePromisifiedEval (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/promisify.js:184:12), :13:39)
8542 verbose stack     at readJson.then.catch.then (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/lib/install/action/refresh-package-json.js:31:12)
8542 verbose stack     at tryCatcher (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
8542 verbose stack     at Promise._settlePromiseFromHandler (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
8542 verbose stack     at Promise._settlePromise (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
8542 verbose stack     at Promise._settlePromise0 (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
8542 verbose stack     at Promise._settlePromises (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
8542 verbose stack     at Promise._fulfill (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
8542 verbose stack     at Promise._settlePromise (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:582:21)
8542 verbose stack     at Promise._settlePromise0 (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
8542 verbose stack     at Promise._settlePromises (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
8542 verbose stack     at Promise._fulfill (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
8542 verbose stack     at Promise._resolveCallback (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:432:57)
8542 verbose stack     at Promise._settlePromiseFromHandler (/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:524:17)
8543 verbose pkgid inotify@1.4.2
8544 verbose cwd /Users/viniciuscarvalho/Dropbox/server
8545 verbose Darwin 16.7.0
8546 verbose argv "/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/bin/node" "/Users/viniciuscarvalho/.nvm/versions/node/v8.5.0/bin/npm" "install"
8547 verbose node v8.5.0
8548 verbose npm  v5.4.2
8549 error code EBADPLATFORM
8550 error notsup Unsupported platform for inotify@1.4.2: wanted {"os":"linux","arch":"any"} (current: {"os":"darwin","arch":"x64"})
8551 error notsup Valid OS:    linux
8551 error notsup Valid Arch:  any
8551 error notsup Actual OS:   darwin
8551 error notsup Actual Arch: x64
8552 verbose exit [ 1, true ]
arvidbjorkstrom added a commit to arvidbjorkstrom/chef-appserver that referenced this issue Oct 9, 2017
@bylomo

This comment has been minimized.

Copy link

commented Dec 27, 2017

Hi, same issue.
└─┬ karma@1.3.0
└─┬ chokidar@1.6.0
└── fsevents@1.0.14

BUT, in my log, why it display:
npm ERR! notsup Unsupported platform for fsevents@0.3.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
it shows 0.3.8 instead of 1.0.14, downgraded and added optionalDependencies are useless....

@marxenegls

This comment has been minimized.

Copy link

commented Apr 14, 2018

same here...
got while installing nodemon+ then sought a scalpel but it too complained ;
hell my mother in law isn't this persistent : \
2018 and npm is still suffering
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/nodemon/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
&
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/shrinkwrap-scalpel/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

@JipingWang

This comment has been minimized.

Copy link

commented Apr 30, 2018

[ERROR] npm : npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.3 (node_modules\fsevents):

@danbao

This comment has been minimized.

Copy link

commented May 4, 2018

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

@chiwoojo

This comment has been minimized.

Copy link

commented May 24, 2018

Is there a root cause analysis for this issue? Curious to know

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
You can’t perform that action at this time.