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

Incorrectly flagging optional dependencies #71

Open
tamzinblake opened this issue Apr 21, 2017 · 6 comments
Open

Incorrectly flagging optional dependencies #71

tamzinblake opened this issue Apr 21, 2017 · 6 comments

Comments

@tamzinblake
Copy link

I'm not sure if this is new or related to #50, but...

My shrinkwrap file includes fsevents with "optional": true and so naturally npm doesn't install it on linux where it's not supported. But when running ember exam, I get:

Missing npm-shrinkwrap packages: 
Package: fsevents
Required by: pagerduty
  * Specified: 1.1.1
  * Installed: (not installed)
Run `rm -rf node_modules/ && npm install` to install missing dependencies.

The optional attribute was just added to npm shrinkwrap around the end of last year, so I wouldn't be surprised if it's not supported here yet, but it probably should be?

Temporary workaround might be just removing that bit from the npm shrinkwrap file for now.

@d-schloss-mvg
Copy link

d-schloss-mvg commented Jun 26, 2017

Having the same issue here:
Developing on a mac machine and CI running on a Linux: (Both nodejs v6.10.0, project is shrinkwraped)

npm install:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

and ember build:

Missing npm-shrinkwrap packages: 
Package: fsevents
Required by: remote-client
  * Specified: 1.1.2
  * Installed: (not installed)

Run `rm -rf node_modules/ && npm install` to install missing dependencies.

package.json:

    "broccoli-asset-rev": "^2.4.5",
    "ember-ajax": "^3.0.0",
    "ember-cli": "2.13.2",
    "ember-cli-app-version": "^3.0.0",
    "ember-cli-babel": "^6.0.0",
    "ember-cli-dependency-checker": "^1.3.0",
    "ember-cli-eslint": "^3.0.0",
    "ember-cli-htmlbars": "^1.1.1",
    "ember-cli-htmlbars-inline-precompile": "^0.4.0",
    "ember-cli-inject-live-reload": "^1.4.1",
    "ember-cli-qunit": "^4.0.0",
    "ember-cli-shims": "^1.1.0",
    "ember-cli-sri": "^2.1.0",
    "ember-cli-uglify": "^1.2.0",
    "ember-data": "~2.13.0",
    "ember-export-application-global": "^2.0.0",
    "ember-load-initializers": "^1.0.0",
    "ember-resolver": "^4.0.0",
    "ember-source": "~2.13.0",
    "loader.js": "^4.2.3"

and [email protected]

@tamzinblake
Copy link
Author

@d-schloss-mvg I upgraded to npm@5 and switched my shrinkwrap file to the new lockfile format, and this problem went away.

@d-schloss-mvg
Copy link

@thomblake Thanks for this hint!

@SergeAstapov
Copy link
Contributor

SergeAstapov commented Sep 22, 2017

Is there a way to handle fsevents which are marked optional in npm-shrinkwrap.json?

Have exactly the same issue as initially posted

@peitschie
Copy link

peitschie commented Feb 23, 2018

Adding a "me to" here as well. I've just migrated a project up to ember 3 & node 8.9.4, and we're now having to re-run npm install a second time to prevent the ember-cli-dependency-checker from complaining 😞 . This is on a Windows 10 environment.

c:\source> npm install
c:\source>npm run start

> [email protected] start C:\Work\Source\opt\emu
> ember serve


Missing npm-shrinkwrap packages:
Package: fsevents
Required by: opt-web
  * Specified: 1.1.3
  * Installed: (not installed)

Run `rm -rf node_modules/ && npm install` to install missing dependencies.



Stack Trace and Error Report: C:\Users\philipp\AppData\Local\Temp/error.dump.24d4374249beaba9d039ac3e7bec0cce.log
An error occurred in the constructor for ember-cli-dependency-checker at C:\Work\Source\opt\emu\node_modules\ember-cli-dependency-checker

c:\source>npm install
c:\source>npm run start
> [email protected] start C:\Work\Source\opt\emu
> ember serve


Build successful (39828ms) – Serving on http://localhost:4200/

UPDATE: I initially generated the shrinkwrap file on Windows, which excludes the fsevents initially. Then, the next npm install appears to add fsevents with optional: true back to the shrinkwrap file. If I then reset this back again, npm run start will work successfully.

@peitschie
Copy link

Just adding, a workaround for this is to:

  1. Add fsevents into the optionalDependencies section of `package.json
  2. Tell people to install using npm install --no-optional

It seems that just using npm install will not install fsevent (as it's not supported, so that is expected), but will still update the shrinkwrap file to list the optional dependency. If you instead to an explicit npm shrinkwrap afterwards, it will update the shrinkwrap file to remove fsevent again.

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

No branches or pull requests

4 participants