I'm trying to convert a markdown to pdf using the npm package markdown-pdf with the code below of index.js and I'm getting these errors after run node index.js.
The first error I got is on my Windows 10 Host Machine, and the second one is on my Ubuntu Guest VirtualBox VM.
Any idea of how to solve this? Anything related with phantomjs package?
index.js
var markdownpdf = require("markdown-pdf"),
fs = require("fs")
markdownpdf().from("./README.md").to("./curriculo.pdf", function() {
console.log("Converted to PDF successfully!")
})
Terminal Output Error - Windows Host VM
internal/child_process.js:319
throw errnoException(err, 'spawn');
^
Error: spawn EPERM
at exports._errnoException (util.js:1018:11)
at ChildProcess.spawn (internal/child_process.js:319:11)
at exports.spawn (child_process.js:378:9)
at Object.exports.execFile (child_process.js:143:15)
at WriteStream.<anonymous>
(C:\Users\User\Documents\localdev\curriculo\node_modules\markdown-pdf\index.js:117:22)
at emitNone (events.js:91:20)
at WriteStream.emit (events.js:185:7)
at finishMaybe (_stream_writable.js:512:14)
at afterWrite (_stream_writable.js:386:3)
at onwrite (_stream_writable.js:376:7)
Terminal Output Error - Ubuntu Guest VM
stream.js:74
throw er; // Unhandled stream error in penter code hereipe.
^
Error: spawn /media/sf_localdev/curriculo/node_modules/phantomjs-prebuilt/lib/phantom\bin\phantomjs.exe ENOENT
at exports._errnoException (util.js:870:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:441:9)
at process._tickCallback (node.js:355:17)
Related
I have recently tried to deploy a app consisting of react frontend and node backend on a linux machine.
While executing the frontend i got the following error:
(I used the command npm start)
node:events:491
throw er; // Unhandled 'error' event
^
Error: spawn xdg-open ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn xdg-open',
path: 'xdg-open',
spawnargs: [ 'http://localhost:3000' ]
}
Node.js v18.12.1
I am trying to create my app build on nextJs (v11.1.0), Webpack (5.30.0) with yarn PnP but 99% of the times my build fails with the following error:
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at ChildProcess.target._send (internal/child_process.js:839:20)
at ChildProcess.target.send (internal/child_process.js:710:19)
at ChildProcessWorker.initialize (/tmp/.yarn/__virtual__/jest-worker-virtual-0fce01769d/0/cache/jest-worker-npm-27.0.0-next.5-6f53fab806-d56bfe67cd.zip/node_modules/jest-worker/build/workers/ChildProcessWorker.js:181:11)
at ChildProcessWorker._onExit (/tmp/.yarn/__virtual__/jest-worker-virtual-0fce01769d/0/cache/jest-worker-npm-27.0.0-next.5-6f53fab806-d56bfe67cd.zip/node_modules/jest-worker/build/workers/ChildProcessWorker.js:275:12)
at ChildProcess.emit (events.js:400:28)
at ChildProcess.emit (domain.js:470:12)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
Emitted 'error' event on ChildProcess instance at:
at internal/child_process.js:843:39
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
I am confused as to why the jest worker is active on build time.
I'm trying to get my Karma Unit tests to run on a remote Jenkins server. This Jenkins server is running on Linux with an old version of PhantomJS already installed and PHANTOMJS_BIN defined in the env. I'm using the gulp-karma and karma-phantomjs-launcher-nonet packages to run the karma tests.
However, when jenkins fires Karma, it seems to be unable to spawn PhantomJS. I get the following error:
[13:33:00] Starting Karma server... [32mINFO [karma]: [39mKarma v0.12.37 server started at http://localhost:9876/ [32mINFO [launcher]: [39mStarting browser PhantomJS [31mERROR [karma]: [39m{ [Error: spawn EACCES] code: 'EACCES', errno: 'EACCES', syscall: 'spawn' } Error: spawn EACCES at exports._errnoException (util.js:874:11) at ChildProcess.spawn (internal/child_process.js:298:11) at exports.spawn (child_process.js:339:9) at Object._execCommand (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launchers/process.js:63:21) at Object._start (/appl/jenkins/workspace/ps-lib/node_modules/karma-phantomjs-launcher-nonet/index.js:40:10) at Object. (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launchers/process.js:14:10) at emitOne (events.js:82:20) at Object.emit (events.js:169:7) at Object.start (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launchers/base.js:40:10) at /appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launcher.js:88:15 at Array.forEach (native) at [object Object].launch (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launcher.js:40:11) at [object Object].invoke (/appl/jenkins/workspace/ps-lib/node_modules/karma/node_modules/di/lib/injector.js:75:15) at Server. (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/server.js:62:18) at Server.g (events.js:260:16) at emitNone (events.js:72:20) at Server.emit (events.js:166:7) at emitListeningNT (net.js:1260:10) at doNTCallback1 (node.js:430:9) at process._tickCallback (node.js:352:17)
/appl/jenkins/workspace/ps-lib/tasks/test.js:15 throw err; ^
Error: karma exited with code 1
at done (/appl/jenkins/workspace/ps-lib/node_modules/gulp-karma/index.js:56:30)
at ChildProcess. (/appl/jenkins/workspace/ps-lib/node_modules/gulp-karma/index.js:82:7)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
So it seems to me that my karma is unable to run PhantomJS due to authorisation reasons, am I right? Still the phantomjs installation is done with user jenkins//jenkins so jenkins should be able to run it, right?
I got this error when I use command react-native init hello in nodejs
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn npm ENOENT
at exports._errnoException (util.js:855:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:455:9)
at process._tickCallback (node.js:369:17)
With the help gulp yeoman-webapp 'im wolf. But it also serves on the command line, I get the following error gulp. Can you help me? Thank you in advance.
I work in Windows 10 and 64 bit computing.
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
Try to put in your system variables in the PATH :
C:\Windows\System32;