Jest expects a native dependency built for Node, but mine are built for Electron - What can I do?










0















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)












share|improve this question



















  • 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 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





    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 use node-pre-gyp.

    – murgatroid99
    Jun 30 '18 at 22:33















0















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)












share|improve this question



















  • 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 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





    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 use node-pre-gyp.

    – murgatroid99
    Jun 30 '18 at 22:33













0












0








0








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)












share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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 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





    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 use node-pre-gyp.

    – murgatroid99
    Jun 30 '18 at 22:33












  • 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 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





    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 use node-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












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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Crossroads (UK TV series)

ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế