-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Optional dependency with a native module is not installed #670
Comments
To clarify, optionalDeps are just like deps except that a failure to install or compile won't kill the overall install. |
Seeing the same, it looks like optional dependencies are not attempted to be built. A manual |
confirmed here:
|
Is there some way of knowing if a failure to compile has occurred? For example, my output looks like:
No obvious errors are shown. |
This also applies to optional dependencies with native code in our own {
"name": "scratch",
"version": "0.0.1",
"description": "Reproduction",
"main": "index.js",
"license": "MIT",
"optionalDependencies": {
"node-zopfli": "^2.0.1"
}
}
It is interesting to note that the binaries get installed, but the library itself doesn't. Running the binaries fails due to unsatisfied dependencies. |
Checking out the package.json for node-zopfli, there's an {
"scripts": {
"install": "node-pre-gyp install --fallback-to-build",
},
} Which... has a space in it! I think that at the root, this issue is yet another thing fixed by #809. The unique problem here might be the failure to run Following the instructions in this comment and this comment to run the master branch of yarn:
I see that the native dependency is now installed when I run Now we just gotta wait for that commit to be released in an official version. |
Pulling master of yarn as @shepmaster suggested resolved this for me as well (my issue was noble and xpc-connection). 👍 |
Which commit was this fixed in? @shepmaster I have the same problem with this simple package.json
Chokidar doesn't get installed |
Please read the previous comment:
|
This issue seems to be fixed in 0.16.0. |
Confirmed this is fixed in 0.16.1, thanks! |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
When I install johnny-five, it's optional dependency serialport with a native module (using node-pre-gyp) is missing from
node_modules
, but installing serialport directly works fine.If the current behavior is a bug, please provide the steps to reproduce.
Using this package.json file:
yarn cache clean
rm yarn.lock
yarn install
cd node_modules
find . -name serialport
returns nothingBut, using this package.json file:
yarn cache clean
rm yarn.lock
yarn install
cd node_modules
find . -name serialport
shows it has been installedWhat is the expected behavior?
Serialport should be installed as a dependency (the npm client works this way).
Please mention your node.js, yarn and operating system version.
Node: 6.7.0
Yarn: 0.15.1
OS: Ubuntu 14.04 x64
The text was updated successfully, but these errors were encountered: