Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove optional dependencies. #17

Closed
digitalsadhu opened this issue Mar 28, 2016 · 11 comments
Closed

Remove optional dependencies. #17

digitalsadhu opened this issue Mar 28, 2016 · 11 comments

Comments

@digitalsadhu
Copy link

  1. Install nodemon on mac
    (mac only dependency fsevents will be installed)
  2. run shrinkwrap and shrinkpack
  3. pull down on a linux machine and run npm install
  4. Get the following error:
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your operating system or architecture: fsevents@1.0.9
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64

Have you run into this sort of thing before? Is it even possible to fix such a thing?

@JamieMason
Copy link
Owner

Thanks for posting this. I could have overlooked something, but I'm not sure how this can be possible given that only the npm tarballs are stored.

Unlikely, but you've not checked in node_modules as well or anything have you?

@digitalsadhu
Copy link
Author

No, not checked in.

Did some digging, looks like the way the fsevents is specified causes the tarball not to be fetched at all when installing from npm.

fsevents is specified as an optional dependency here:
https://github.com/paulmillr/chokidar/blob/master/package.json#L41

and the os is specified here:
https://github.com/strongloop/fsevents/blob/master/package.json#L10

and according to this issue: http://stackoverflow.com/questions/15176082/npm-package-json-os-specific-dependency this will mean that fsevents will simply not be installed (in at least normal installation via npm)

In this case however, the original OS was mac so the tarball was pulled down and cached. Then when moving to linux I guess it will try to extract and install the tarball causing the issue.

@JamieMason
Copy link
Owner

That's really useful, thanks a lot for digging that up. I'll have a think about what can be done about it.

@digitalsadhu
Copy link
Author

👍

@JamieMason JamieMason added bug and removed bug labels Apr 3, 2016
@JamieMason
Copy link
Owner

@digitalsadhu could you do me a favour? if you were to follow the same steps but without using shrinkpack at all, does this still happen? ie. is it a npm shrinkwrap thing? Or does also using shrinkpack introduce the problem?

@kkemple
Copy link

kkemple commented Jun 23, 2016

For anyone who runs into this and doesn't want to wait for the NPM fix here is a workaround :: https://github.com/bocoup/service-catalog/blob/fe3fab7fc67d7b0e595db59e90377b5a8dbe7338/tools/fix-shrinkwrap.js

@JamieMason
Copy link
Owner

Thanks a lot Kurtis, that'll be handy.

@JamieMason JamieMason changed the title Cross platform build errors Remove optional dependencies. Jun 27, 2016
@JamieMason
Copy link
Owner

Reopening to apply bocoup's fix as per @kkemple's #17 (comment).

@JamieMason JamieMason reopened this Jun 27, 2016
@JamieMason
Copy link
Owner

Sorry for the wait @digitalsadhu @kkemple – a proposed fix is now in develop.

@kkemple
Copy link

kkemple commented Aug 9, 2016

thanks for this addition! can't wait to remove my custom script everywhere!

@JamieMason
Copy link
Owner

JamieMason commented Aug 9, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants