Using fs, path and child_process only possible in background.ts
See original GitHub issueI instaled vue with latest version of vue-cli and npm, chose typescript and added the builder.
I tried to import child_process from the helloWorld component but on riuntime it is an empty object. In the background.ts it works.
For some reason vscode tells me that ther is no electron-devtools-installer (in background.ts).
But it throws no error.
this is the working import in background.ts
import * as child from 'child_process'; console.log(child);
Do I have to pass the variable in some way to the vue app?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to wait for a child process to finish in Node.js
This is a better answer. You should avoid blocking (synchronous) code in Node wherever possible - it halts your entire program whilst waiting...
Read more >How To Launch Child Processes in Node.js - DigitalOcean
In this tutorial, you will create child processes while executing a series of sample Node.js applications. You'll create processes with the ...
Read more >Child process | Node.js v19.3.0 Documentation
By default, child_process.fork() will spawn new Node.js instances using the process.execPath of the parent process. The execPath property in the options object ...
Read more >Module not found: Can't resolve 'child_process' #192 - GitHub
I'm using Node v6.11.2 and the code is copy-paste from the examples. Any ideas? I tried manually instaling the dependencies, because I noticed ......
Read more >Worker Threads with TypeScript - Node.js TypeScript #12
const path = require('path');. require('ts-node').register() ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You will have to enable nodeIntegration to use native node modules in the renderer process. Please try that and let me know if it works.
For security reason I created a preload.js in between of the background.js and the renderer (VUE component). While sending messages with IPC ExampleComponent.vue --> Preload.js --> background.js just works fine, I can’t get a simple console.log() statement out of the preload.js. It always appears directly in the chromium browser console but should appear in the normal terminal (or VUE UI).