Jest expects a native dependency built for Node, but mine are built for Electron - What can I do?
How can I resolve a situation where Jest wants native dependencies built for node, but I build them for Electron (using npm rebuild --runtime=electron --target=2.0.2 --disturl=https://atom.io/download/atom-shell --build-from-source
)
How can I get Jest to use the modules built for Electron
, or manage both simultaneously?
Node 8.11.3
Yarn 1.7.0
NPM 5.6.0
warning package.json: License should be a valid SPDX license expression
$ jest --no-cache --colors
FAIL app/redux/sagas/things/__tests__/database.test.js
● Test suite failed to run
Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-win32-x64-unknown
Found: [electron-v2.0-win32-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module 'C:projectsmyAppappnode_modulesgrpcsrcnodeextension_binarynode-v57-win32-x64-unknowngrpc_node.node' from 'grpc_extension.js'
> 1 | import firebase from 'firebase';
| ^
2 | import '@firebase/storage';
3 | import ReduxSagaFirebase from 'redux-saga-firebase';
4 | import validate from 'uuid-validate';
at Object.<anonymous> (app/node_modules/grpc/src/grpc_extension.js:53:17)
at Object.<anonymous> (app/node_modules/grpc/src/client_interceptors.js:145:12)
at Object.<anonymous> (app/node_modules/grpc/src/client.js:37:27)
at Object.<anonymous> (app/node_modules/grpc/index.js:30:14)
at Object.<anonymous> (app/node_modules/@firebase/firestore/dist/index.node.cjs.js:10:12)
at Object.<anonymous> (app/node_modules/firebase/dist/index.node.cjs.js:9:1)
at Object.<anonymous> (app/redux/sagas/rsf.js:1:1)
at Object.<anonymous> (app/redux/sagas/sagaHelpers.js:19:1)
at Object.<anonymous> (app/redux/sagas/things/database/general.js:6:1)
at Object.<anonymous> (app/redux/sagas/things/database.js:7:1)
at Object.<anonymous> (app/redux/sagas/things/__tests__/database.test.js:2:1)
javascript node.js electron jestjs grpc
|
show 4 more comments
How can I resolve a situation where Jest wants native dependencies built for node, but I build them for Electron (using npm rebuild --runtime=electron --target=2.0.2 --disturl=https://atom.io/download/atom-shell --build-from-source
)
How can I get Jest to use the modules built for Electron
, or manage both simultaneously?
Node 8.11.3
Yarn 1.7.0
NPM 5.6.0
warning package.json: License should be a valid SPDX license expression
$ jest --no-cache --colors
FAIL app/redux/sagas/things/__tests__/database.test.js
● Test suite failed to run
Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-win32-x64-unknown
Found: [electron-v2.0-win32-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module 'C:projectsmyAppappnode_modulesgrpcsrcnodeextension_binarynode-v57-win32-x64-unknowngrpc_node.node' from 'grpc_extension.js'
> 1 | import firebase from 'firebase';
| ^
2 | import '@firebase/storage';
3 | import ReduxSagaFirebase from 'redux-saga-firebase';
4 | import validate from 'uuid-validate';
at Object.<anonymous> (app/node_modules/grpc/src/grpc_extension.js:53:17)
at Object.<anonymous> (app/node_modules/grpc/src/client_interceptors.js:145:12)
at Object.<anonymous> (app/node_modules/grpc/src/client.js:37:27)
at Object.<anonymous> (app/node_modules/grpc/index.js:30:14)
at Object.<anonymous> (app/node_modules/@firebase/firestore/dist/index.node.cjs.js:10:12)
at Object.<anonymous> (app/node_modules/firebase/dist/index.node.cjs.js:9:1)
at Object.<anonymous> (app/redux/sagas/rsf.js:1:1)
at Object.<anonymous> (app/redux/sagas/sagaHelpers.js:19:1)
at Object.<anonymous> (app/redux/sagas/things/database/general.js:6:1)
at Object.<anonymous> (app/redux/sagas/things/database.js:7:1)
at Object.<anonymous> (app/redux/sagas/things/__tests__/database.test.js:2:1)
javascript node.js electron jestjs grpc
1
Have you tried running justnpm rebuild
without any arguments after the command you ran to install the electron binaries?
– murgatroid99
Jun 25 '18 at 20:16
I have and that works for testing, but I can't run my Electron application in that configuration which makes the testing not very useful at all unfortunately.
– Slbox
Jun 25 '18 at 21:42
1
OK, when I try doing that on my own machine, I end up with both binary files. One thing I would suggest trying is removing the--build-from-source
from yournpm rebuild
command. You don't need it, at least for gRPC. If you have other native dependencies, you can add--build-from-source=<other-package>
.
– murgatroid99
Jun 25 '18 at 21:59
1
I tested that on Linux, but I don't think that should make a difference here.
– murgatroid99
Jun 25 '18 at 22:06
1
In general, I expect that many libraries that usenode-pre-gyp
to distribute binaries have that property, but not necessarily all of them, and many libraries don't usenode-pre-gyp
.
– murgatroid99
Jun 30 '18 at 22:33
|
show 4 more comments
How can I resolve a situation where Jest wants native dependencies built for node, but I build them for Electron (using npm rebuild --runtime=electron --target=2.0.2 --disturl=https://atom.io/download/atom-shell --build-from-source
)
How can I get Jest to use the modules built for Electron
, or manage both simultaneously?
Node 8.11.3
Yarn 1.7.0
NPM 5.6.0
warning package.json: License should be a valid SPDX license expression
$ jest --no-cache --colors
FAIL app/redux/sagas/things/__tests__/database.test.js
● Test suite failed to run
Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-win32-x64-unknown
Found: [electron-v2.0-win32-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module 'C:projectsmyAppappnode_modulesgrpcsrcnodeextension_binarynode-v57-win32-x64-unknowngrpc_node.node' from 'grpc_extension.js'
> 1 | import firebase from 'firebase';
| ^
2 | import '@firebase/storage';
3 | import ReduxSagaFirebase from 'redux-saga-firebase';
4 | import validate from 'uuid-validate';
at Object.<anonymous> (app/node_modules/grpc/src/grpc_extension.js:53:17)
at Object.<anonymous> (app/node_modules/grpc/src/client_interceptors.js:145:12)
at Object.<anonymous> (app/node_modules/grpc/src/client.js:37:27)
at Object.<anonymous> (app/node_modules/grpc/index.js:30:14)
at Object.<anonymous> (app/node_modules/@firebase/firestore/dist/index.node.cjs.js:10:12)
at Object.<anonymous> (app/node_modules/firebase/dist/index.node.cjs.js:9:1)
at Object.<anonymous> (app/redux/sagas/rsf.js:1:1)
at Object.<anonymous> (app/redux/sagas/sagaHelpers.js:19:1)
at Object.<anonymous> (app/redux/sagas/things/database/general.js:6:1)
at Object.<anonymous> (app/redux/sagas/things/database.js:7:1)
at Object.<anonymous> (app/redux/sagas/things/__tests__/database.test.js:2:1)
javascript node.js electron jestjs grpc
How can I resolve a situation where Jest wants native dependencies built for node, but I build them for Electron (using npm rebuild --runtime=electron --target=2.0.2 --disturl=https://atom.io/download/atom-shell --build-from-source
)
How can I get Jest to use the modules built for Electron
, or manage both simultaneously?
Node 8.11.3
Yarn 1.7.0
NPM 5.6.0
warning package.json: License should be a valid SPDX license expression
$ jest --no-cache --colors
FAIL app/redux/sagas/things/__tests__/database.test.js
● Test suite failed to run
Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-win32-x64-unknown
Found: [electron-v2.0-win32-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module 'C:projectsmyAppappnode_modulesgrpcsrcnodeextension_binarynode-v57-win32-x64-unknowngrpc_node.node' from 'grpc_extension.js'
> 1 | import firebase from 'firebase';
| ^
2 | import '@firebase/storage';
3 | import ReduxSagaFirebase from 'redux-saga-firebase';
4 | import validate from 'uuid-validate';
at Object.<anonymous> (app/node_modules/grpc/src/grpc_extension.js:53:17)
at Object.<anonymous> (app/node_modules/grpc/src/client_interceptors.js:145:12)
at Object.<anonymous> (app/node_modules/grpc/src/client.js:37:27)
at Object.<anonymous> (app/node_modules/grpc/index.js:30:14)
at Object.<anonymous> (app/node_modules/@firebase/firestore/dist/index.node.cjs.js:10:12)
at Object.<anonymous> (app/node_modules/firebase/dist/index.node.cjs.js:9:1)
at Object.<anonymous> (app/redux/sagas/rsf.js:1:1)
at Object.<anonymous> (app/redux/sagas/sagaHelpers.js:19:1)
at Object.<anonymous> (app/redux/sagas/things/database/general.js:6:1)
at Object.<anonymous> (app/redux/sagas/things/database.js:7:1)
at Object.<anonymous> (app/redux/sagas/things/__tests__/database.test.js:2:1)
warning package.json: License should be a valid SPDX license expression
$ jest --no-cache --colors
FAIL app/redux/sagas/things/__tests__/database.test.js
● Test suite failed to run
Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-win32-x64-unknown
Found: [electron-v2.0-win32-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module 'C:projectsmyAppappnode_modulesgrpcsrcnodeextension_binarynode-v57-win32-x64-unknowngrpc_node.node' from 'grpc_extension.js'
> 1 | import firebase from 'firebase';
| ^
2 | import '@firebase/storage';
3 | import ReduxSagaFirebase from 'redux-saga-firebase';
4 | import validate from 'uuid-validate';
at Object.<anonymous> (app/node_modules/grpc/src/grpc_extension.js:53:17)
at Object.<anonymous> (app/node_modules/grpc/src/client_interceptors.js:145:12)
at Object.<anonymous> (app/node_modules/grpc/src/client.js:37:27)
at Object.<anonymous> (app/node_modules/grpc/index.js:30:14)
at Object.<anonymous> (app/node_modules/@firebase/firestore/dist/index.node.cjs.js:10:12)
at Object.<anonymous> (app/node_modules/firebase/dist/index.node.cjs.js:9:1)
at Object.<anonymous> (app/redux/sagas/rsf.js:1:1)
at Object.<anonymous> (app/redux/sagas/sagaHelpers.js:19:1)
at Object.<anonymous> (app/redux/sagas/things/database/general.js:6:1)
at Object.<anonymous> (app/redux/sagas/things/database.js:7:1)
at Object.<anonymous> (app/redux/sagas/things/__tests__/database.test.js:2:1)
warning package.json: License should be a valid SPDX license expression
$ jest --no-cache --colors
FAIL app/redux/sagas/things/__tests__/database.test.js
● Test suite failed to run
Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-win32-x64-unknown
Found: [electron-v2.0-win32-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module 'C:projectsmyAppappnode_modulesgrpcsrcnodeextension_binarynode-v57-win32-x64-unknowngrpc_node.node' from 'grpc_extension.js'
> 1 | import firebase from 'firebase';
| ^
2 | import '@firebase/storage';
3 | import ReduxSagaFirebase from 'redux-saga-firebase';
4 | import validate from 'uuid-validate';
at Object.<anonymous> (app/node_modules/grpc/src/grpc_extension.js:53:17)
at Object.<anonymous> (app/node_modules/grpc/src/client_interceptors.js:145:12)
at Object.<anonymous> (app/node_modules/grpc/src/client.js:37:27)
at Object.<anonymous> (app/node_modules/grpc/index.js:30:14)
at Object.<anonymous> (app/node_modules/@firebase/firestore/dist/index.node.cjs.js:10:12)
at Object.<anonymous> (app/node_modules/firebase/dist/index.node.cjs.js:9:1)
at Object.<anonymous> (app/redux/sagas/rsf.js:1:1)
at Object.<anonymous> (app/redux/sagas/sagaHelpers.js:19:1)
at Object.<anonymous> (app/redux/sagas/things/database/general.js:6:1)
at Object.<anonymous> (app/redux/sagas/things/database.js:7:1)
at Object.<anonymous> (app/redux/sagas/things/__tests__/database.test.js:2:1)
javascript node.js electron jestjs grpc
javascript node.js electron jestjs grpc
edited Nov 12 '18 at 13:18
skyboyer
3,84311229
3,84311229
asked Jun 25 '18 at 18:03
SlboxSlbox
1,11331432
1,11331432
1
Have you tried running justnpm rebuild
without any arguments after the command you ran to install the electron binaries?
– murgatroid99
Jun 25 '18 at 20:16
I have and that works for testing, but I can't run my Electron application in that configuration which makes the testing not very useful at all unfortunately.
– Slbox
Jun 25 '18 at 21:42
1
OK, when I try doing that on my own machine, I end up with both binary files. One thing I would suggest trying is removing the--build-from-source
from yournpm rebuild
command. You don't need it, at least for gRPC. If you have other native dependencies, you can add--build-from-source=<other-package>
.
– murgatroid99
Jun 25 '18 at 21:59
1
I tested that on Linux, but I don't think that should make a difference here.
– murgatroid99
Jun 25 '18 at 22:06
1
In general, I expect that many libraries that usenode-pre-gyp
to distribute binaries have that property, but not necessarily all of them, and many libraries don't usenode-pre-gyp
.
– murgatroid99
Jun 30 '18 at 22:33
|
show 4 more comments
1
Have you tried running justnpm rebuild
without any arguments after the command you ran to install the electron binaries?
– murgatroid99
Jun 25 '18 at 20:16
I have and that works for testing, but I can't run my Electron application in that configuration which makes the testing not very useful at all unfortunately.
– Slbox
Jun 25 '18 at 21:42
1
OK, when I try doing that on my own machine, I end up with both binary files. One thing I would suggest trying is removing the--build-from-source
from yournpm rebuild
command. You don't need it, at least for gRPC. If you have other native dependencies, you can add--build-from-source=<other-package>
.
– murgatroid99
Jun 25 '18 at 21:59
1
I tested that on Linux, but I don't think that should make a difference here.
– murgatroid99
Jun 25 '18 at 22:06
1
In general, I expect that many libraries that usenode-pre-gyp
to distribute binaries have that property, but not necessarily all of them, and many libraries don't usenode-pre-gyp
.
– murgatroid99
Jun 30 '18 at 22:33
1
1
Have you tried running just
npm rebuild
without any arguments after the command you ran to install the electron binaries?– murgatroid99
Jun 25 '18 at 20:16
Have you tried running just
npm rebuild
without any arguments after the command you ran to install the electron binaries?– murgatroid99
Jun 25 '18 at 20:16
I have and that works for testing, but I can't run my Electron application in that configuration which makes the testing not very useful at all unfortunately.
– Slbox
Jun 25 '18 at 21:42
I have and that works for testing, but I can't run my Electron application in that configuration which makes the testing not very useful at all unfortunately.
– Slbox
Jun 25 '18 at 21:42
1
1
OK, when I try doing that on my own machine, I end up with both binary files. One thing I would suggest trying is removing the
--build-from-source
from your npm rebuild
command. You don't need it, at least for gRPC. If you have other native dependencies, you can add --build-from-source=<other-package>
.– murgatroid99
Jun 25 '18 at 21:59
OK, when I try doing that on my own machine, I end up with both binary files. One thing I would suggest trying is removing the
--build-from-source
from your npm rebuild
command. You don't need it, at least for gRPC. If you have other native dependencies, you can add --build-from-source=<other-package>
.– murgatroid99
Jun 25 '18 at 21:59
1
1
I tested that on Linux, but I don't think that should make a difference here.
– murgatroid99
Jun 25 '18 at 22:06
I tested that on Linux, but I don't think that should make a difference here.
– murgatroid99
Jun 25 '18 at 22:06
1
1
In general, I expect that many libraries that use
node-pre-gyp
to distribute binaries have that property, but not necessarily all of them, and many libraries don't use node-pre-gyp
.– murgatroid99
Jun 30 '18 at 22:33
In general, I expect that many libraries that use
node-pre-gyp
to distribute binaries have that property, but not necessarily all of them, and many libraries don't use node-pre-gyp
.– murgatroid99
Jun 30 '18 at 22:33
|
show 4 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51029433%2fjest-expects-a-native-dependency-built-for-node-but-mine-are-built-for-electron%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51029433%2fjest-expects-a-native-dependency-built-for-node-but-mine-are-built-for-electron%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Have you tried running just
npm rebuild
without any arguments after the command you ran to install the electron binaries?– murgatroid99
Jun 25 '18 at 20:16
I have and that works for testing, but I can't run my Electron application in that configuration which makes the testing not very useful at all unfortunately.
– Slbox
Jun 25 '18 at 21:42
1
OK, when I try doing that on my own machine, I end up with both binary files. One thing I would suggest trying is removing the
--build-from-source
from yournpm rebuild
command. You don't need it, at least for gRPC. If you have other native dependencies, you can add--build-from-source=<other-package>
.– murgatroid99
Jun 25 '18 at 21:59
1
I tested that on Linux, but I don't think that should make a difference here.
– murgatroid99
Jun 25 '18 at 22:06
1
In general, I expect that many libraries that use
node-pre-gyp
to distribute binaries have that property, but not necessarily all of them, and many libraries don't usenode-pre-gyp
.– murgatroid99
Jun 30 '18 at 22:33