Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

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

@paglias

Description

@paglias

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions