I am trying to run the following in a node script:
/bin/sh -c '/Users/edwardthompson/IdeaProjects/evidentia4/evidentia4/package/macosx/e/wkhtmltopdf --page-size "letter" --footer-center "[page] of [topage]" --footer-left "Prepared Jul 7, 2019 by Edward A Thompson" --footer-right "Evidentia(c) 2012-2017" --footer-font-size "10" --footer-font-name "Times" --print-media-type /var/folders/45/2rx5vf4j47jf4hx5157q4q800000gn/T/ResearchSummaryReport-201967122421963.html /var/folders/45/2rx5vf4j47jf4hx5157q4q800000gn/T/ResearchSummaryReport-201967122421964.pdf'
Running from the command line, it works fine, but I have to have the quotes around everything being passed to /bin/sh -c
When I do the same thing in a node script:
child = child_process.spawn('/bin/sh -c', ["'" + args.join(' ') + "'"], {stdio: 'inherit'});
I get:
Message:
Uncaught exception: Error: spawn /bin/sh -c ENOENT
Stack:
error properties: Object({ errno: 'ENOENT', code: 'ENOENT', syscall: 'spawn /bin/sh -c', path: '/bin/sh -c', spawnargs: [ ''/Users/edwardthompson/IdeaProjects/evidentia4/evidentia4/package/macosx/e/wkhtmltopdf --page-size "letter" --footer-center "[page] of [topage]" --footer-left "Prepared Jul 7, 2019 by Edward A Thompson" --footer-right "Evidentia(c) 2012-2017" --footer-font-size "10" --footer-font-name "Times" --print-media-type /var/folders/45/2rx5vf4j47jf4hx5157q4q800000gn/T/ResearchSummaryReport-20196712254722.html /var/folders/45/2rx5vf4j47jf4hx5157q4q800000gn/T/ResearchSummaryReport-20196712254722.pdf'' ] })
Error: spawn /bin/sh -c ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:74:11)
Can't figure this one out...
child_process.spawn is looking for a file with a path of "/bin/sh -c", which does not exist. You should pass -c as a parameter instead.
Try this:
child = child_process.spawn('/bin/sh', ["-c","'" + args.join(' ') + "'"], {stdio: 'inherit'});
Related
I created a node.js application locally on my windows machine.
I cloned the application on ubuntu and I packaged my node.js app to node16-linux-arm64 using pkg.
When I try to run the application on ubuntu I receive this error:
pkg/prelude/bootstrap.js:1876
throw error;
^
Error: EACCES: permission denied, open '/home/gs/smart-autonom/smart-autonom-groups-server/gsev-smart-autonom.log'
at Object.openSync (fs.js:443:3)
at Object.openSync (pkg/prelude/bootstrap.js:796:32)
at Object.writeFileSync (fs.js:1194:35)
at Object.appendFileSync (fs.js:1240:6)
at RollingFileStream._renewWriteStream (/snapshot/smart-autonom-groups-server/node_modules/streamroller/lib/RollingFileWriteStream.js:312:8)
at new RollingFileWriteStream (/snapshot/smart-autonom-groups-server/node_modules/streamroller/lib/RollingFileWriteStream.js:94:10)
at new RollingFileStream (/snapshot/smart-autonom-groups-server/node_modules/streamroller/lib/RollingFileStream.js:18:5)
at openTheStream (/snapshot/smart-autonom-groups-server/node_modules/log4js/lib/appenders/file.js:64:20)
at fileAppender (/snapshot/smart-autonom-groups-server/node_modules/log4js/lib/appenders/file.js:84:16)
at Object.configure (/snapshot/smart-autonom-groups-server/node_modules/log4js/lib/appenders/file.js:144:10)
at clustering.onlyOnMaster (/snapshot/smart-autonom-groups-server/node_modules/log4js/lib/appenders/index.js:117:29)
at Object.onlyOnMaster (/snapshot/smart-autonom-groups-server/node_modules/log4js/lib/clustering.js:87:50)
at createAppender (/snapshot/smart-autonom-groups-server/node_modules/log4js/lib/appenders/index.js:112:21)
at getAppender (/snapshot/smart-autonom-groups-server/node_modules/log4js/lib/appenders/index.js:68:20)
at Object.keys.forEach (/snapshot/smart-autonom-groups-server/node_modules/log4js/lib/appenders/index.js:147:7)
at Array.forEach (<anonymous>) {
errno: -13,
syscall: 'open',
code: 'EACCES',
path: '/home/gs/smart-autonom/smart-autonom-groups-server/gsev-smart-autonom.log'
}
'gsev-smart-autonom.log' does not even exists.
This is where I specify in code the path for all the logs to be saved:
log4js.configure({
appenders: {
main: {
type: 'file',
// TODO: move filename to config?
filename: 'gsev-smart-autonom.log',
// max 2MB ?
maxLogSize: 512 * 4 * 1024,
// max 10 backups
backups: 10,
// compress as .gz to save space
compress: true,
},
},
categories: {
default: {
appenders: ['main'],
level: 'trace',
},
},
});
I tried different solutions with no result. I spent about 2 days on this error and no success yet.
What might be the solution ? Thank you :)
I am using https://www.npmjs.com/package/pdf2pic to convert my PDF to image.
const PDF2Pic = require('pdf2pic');
const pdf2pic = new PDF2Pic({
density: 100, // output pixels per inch
savename: 'untitled', // output file name
savedir: './images', // output file location
format: 'png', // output file format
size: '600x600', // output size in pixels
});
const file = "/Users/kar1/Downloads/bw.pdf"
async function recognizeFile(file) {
pdf2pic.convertBulk(file, -1).then((resolve) => {
console.log('image converter successfully!');
return resolve;
});
}
recognizeFile(file)
The error :
(node:32605) UnhandledPromiseRejectionWarning: Error: Could not execute GraphicsMagick/ImageMagick: gm "identify" "-ping" "-format" "%p" "/Users/kar1/Downloads/bw.pdf" this most likely means the gm/convert binaries can't be found
at ChildProcess.<anonymous> (/Users/kar1/Desktop/github/pdfToPic/node_modules/gm/lib/command.js:232:12)
at ChildProcess.emit (events.js:315:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
I tried :
brew install imagemagick
And the issue still persists. How can I solve this?
Problem got solved by running these commands :
brew install imagemagick
brew install gs
While trying to deploy my app on Heroku, I encountered an error as stated in the title: Fatal error: alsa/soundlib.h: No such file or directory
I don't know why this package is troubling me in the first place 'cause i didn't install it and i can't figure out which of my dependencies is depending on it. Anyway, does anyone have idea of how to fix it?
Here is my package.json:
{
"name": "audio-manager",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon server.js",
"dev": "next dev",
"build": "next build",
"next-start": "next start",
"ngrok-start": "ngrok http 3000"
},
"engines": {
"node": "12.x"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"#shopify/app-bridge-react": "^1.26.2",
"#shopify/koa-shopify-auth": "^3.1.65",
"#shopify/koa-shopify-graphql-proxy": "^4.0.1",
"#zeit/next-css": "^1.0.1",
"apollo-boost": "^0.4.9",
"crypto": "^1.0.1",
"dotenv": "^8.2.0",
"generate-sound-waveform": "^0.1.11",
"graphql": "^15.3.0",
"js-cookie": "^2.2.1",
"koa": "^2.13.0",
"koa-body": "^4.2.0",
"koa-router": "^9.1.0",
"koa-session": "^6.0.0",
"next": "^9.4.4",
"querystring": "^0.2.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"safe-compare": "^1.1.4",
"webpack": "^4.44.0"
}
}
I already ran the command: sudo apt-get install libasound2-dev and it installed, but anytime i run npm install it shows this message in the console:
npm install
npm WARN deprecated crypto#1.0.1: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
npm WARN deprecated mkdirp#0.5.3: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated coffee-script#1.7.1: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated mkdirp#0.3.5: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
> speaker#0.3.1 install /home/israel/Documents/sound-wave-image-generator/node_modules/speaker
> node-gyp rebuild
make: Entering directory '/home/israel/Documents/sound-wave-image-generator/node_modules/speaker/build'
CC(target) Release/obj.target/output/deps/mpg123/src/output/alsa.o
../deps/mpg123/src/output/alsa.c: In function ‘initialize_device’:
../deps/mpg123/src/output/alsa.c:78:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
78 | for (i = 0; i < NUM_FORMATS; ++i) {
| ^
../deps/mpg123/src/output/alsa.c: In function ‘get_formats_alsa’:
../deps/mpg123/src/output/alsa.c:201:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
201 | for (i = 0; i < NUM_FORMATS; ++i) {
| ^
AR(target) Release/obj.target/deps/mpg123/liboutput.a
COPY Release/liboutput.a
CXX(target) Release/obj.target/binding/src/binding.o
In file included from ../src/node_pointer.h:6,
from ../src/binding.cc:5:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
2294 | , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
| ^
../src/binding.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Open(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/binding.cc:30:38: error: no matching function for call to ‘v8::Value::Int32Value()’
30 | ao->channels = info[1]->Int32Value(); /* channels */
| ^
In file included from /home/israel/.cache/node-gyp/12.18.3/include/node/node.h:67,
from ../../nan/nan.h:56,
from ../src/node_pointer.h:6,
from ../src/binding.cc:5:
/home/israel/.cache/node-gyp/12.18.3/include/node/v8.h:2709:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2709 | V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
| ^~~~~~~~~~
/home/israel/.cache/node-gyp/12.18.3/include/node/v8.h:2709:40: note: candidate expects 1 argument, 0 provided
../src/binding.cc:31:34: error: no matching function for call to ‘v8::Value::Int32Value()’
31 | ao->rate = info[2]->Int32Value(); /* sample rate */
| ^
In file included from /home/israel/.cache/node-gyp/12.18.3/include/node/node.h:67,
from ../../nan/nan.h:56,
from ../src/node_pointer.h:6,
from ../src/binding.cc:5:
/home/israel/.cache/node-gyp/12.18.3/include/node/v8.h:2709:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2709 | V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
| ^~~~~~~~~~
/home/israel/.cache/node-gyp/12.18.3/include/node/v8.h:2709:40: note: candidate expects 1 argument, 0 provided
../src/binding.cc:32:36: error: no matching function for call to ‘v8::Value::Int32Value()’
32 | ao->format = info[3]->Int32Value(); /* MPG123_ENC_* format */
| ^
In file included from /home/israel/.cache/node-gyp/12.18.3/include/node/node.h:67,
from ../../nan/nan.h:56,
from ../src/node_pointer.h:6,
from ../src/binding.cc:5:
/home/israel/.cache/node-gyp/12.18.3/include/node/v8.h:2709:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2709 | V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
| ^~~~~~~~~~
/home/israel/.cache/node-gyp/12.18.3/include/node/v8.h:2709:40: note: candidate expects 1 argument, 0 provided
../src/binding.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Write(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/binding.cc:51:33: error: no matching function for call to ‘v8::Value::Int32Value()’
51 | int len = info[2]->Int32Value();
| ^
In file included from /home/israel/.cache/node-gyp/12.18.3/include/node/node.h:67,
from ../../nan/nan.h:56,
from ../src/node_pointer.h:6,
from ../src/binding.cc:5:
/home/israel/.cache/node-gyp/12.18.3/include/node/v8.h:2709:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2709 | V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
| ^~~~~~~~~~
/home/israel/.cache/node-gyp/12.18.3/include/node/v8.h:2709:40: note: candidate expects 1 argument, 0 provided
../src/binding.cc:62:78: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
62 | uv_queue_work(uv_default_loop(), &req->req, write_async, (uv_after_work_cb)write_after);
| ^~~~~~~~~~~
../src/binding.cc: In function ‘void {anonymous}::write_after(uv_work_t*)’:
../src/binding.cc:80:31: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
80 | wreq->callback->Call(1, argv);
| ^
In file included from ../src/node_pointer.h:6,
from ../src/binding.cc:5:
../../nan/nan.h:1742:3: note: declared here
1742 | Call(int argc, v8::Local<v8::Value> argv[]) const {
| ^~~~
../src/binding.cc: At global scope:
../src/binding.cc:104:17: error: variable or field ‘Initialize’ declared void
104 | void Initialize(Handle<Object> target) {
| ^~~~~~
../src/binding.cc:104:17: error: ‘Handle’ was not declared in this scope
../src/binding.cc:104:30: error: expected primary-expression before ‘>’ token
104 | void Initialize(Handle<Object> target) {
| ^
../src/binding.cc:104:32: error: ‘target’ was not declared in this scope
104 | void Initialize(Handle<Object> target) {
| ^~~~~~
In file included from ../../nan/nan.h:56,
from ../src/node_pointer.h:6,
from ../src/binding.cc:5:
../src/binding.cc:155:22: error: ‘Initialize’ was not declared in this scope
155 | NODE_MODULE(binding, Initialize)
| ^~~~~~~~~~
/home/israel/.cache/node-gyp/12.18.3/include/node/node.h:608:36: note: in definition of macro ‘NODE_MODULE_X’
608 | (node::addon_register_func) (regfunc), \
| ^~~~~~~
../src/binding.cc:155:1: note: in expansion of macro ‘NODE_MODULE’
155 | NODE_MODULE(binding, Initialize)
| ^~~~~~~~~~~
In file included from ../src/node_pointer.h:6,
from ../src/binding.cc:5:
../src/binding.cc:93:12: warning: ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Close(Nan::NAN_METHOD_ARGS_TYPE)’ defined but not used [-Wunused-function]
93 | NAN_METHOD(Close) {
| ^~~~~
../../nan/nan.h:1568:33: note: in definition of macro ‘NAN_METHOD’
1568 | Nan::NAN_METHOD_RETURN_TYPE name(Nan::NAN_METHOD_ARGS_TYPE info)
| ^~~~
../src/binding.cc:85:12: warning: ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Flush(Nan::NAN_METHOD_ARGS_TYPE)’ defined but not used [-Wunused-function]
85 | NAN_METHOD(Flush) {
| ^~~~~
../../nan/nan.h:1568:33: note: in definition of macro ‘NAN_METHOD’
1568 | Nan::NAN_METHOD_RETURN_TYPE name(Nan::NAN_METHOD_ARGS_TYPE info)
| ^~~~
../src/binding.cc:47:12: warning: ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Write(Nan::NAN_METHOD_ARGS_TYPE)’ defined but not used [-Wunused-function]
47 | NAN_METHOD(Write) {
| ^~~~~
../../nan/nan.h:1568:33: note: in definition of macro ‘NAN_METHOD’
1568 | Nan::NAN_METHOD_RETURN_TYPE name(Nan::NAN_METHOD_ARGS_TYPE info)
| ^~~~
../src/binding.cc:24:12: warning: ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Open(Nan::NAN_METHOD_ARGS_TYPE)’ defined but not used [-Wunused-function]
24 | NAN_METHOD(Open) {
| ^~~~
../../nan/nan.h:1568:33: note: in definition of macro ‘NAN_METHOD’
1568 | Nan::NAN_METHOD_RETURN_TYPE name(Nan::NAN_METHOD_ARGS_TYPE info)
| ^~~~
make: *** [binding.target.mk:122: Release/obj.target/binding/src/binding.o] Error 1
make: Leaving directory '/home/israel/Documents/sound-wave-image-generator/node_modules/speaker/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/israel/.nvm/versions/node/v12.18.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.4.0-42-generic
gyp ERR! command "/home/israel/.nvm/versions/node/v12.18.3/bin/node" "/home/israel/.nvm/versions/node/v12.18.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/israel/Documents/sound-wave-image-generator/node_modules/speaker
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
I also ran the command: locate asoundlib.h and it gave the following result:
israel#israel-Latitude-E7470:~/Documents/sound-wave-image-generator$ locate asound lib.h
/home/israel/.cache/node-gyp/10.19.0/include/node/zlib.h
/home/israel/.cache/node-gyp/12.18.3/include/node/zlib.h
/home/israel/.nvm/versions/node/v12.18.3/include/node/zlib.h
/home/israel/.nvm/versions/node/v9.0.0/include/node/zlib.h
/home/israel/Documents/Israel-Training-Hamsa/sample-form/node_modules/#apollo/client/node_modules/tslib/tslib.html
/home/israel/Documents/Israel-Training-Hamsa/sample-form/node_modules/#apollo/react-common/node_modules/tslib/tslib.html
/home/israel/Documents/Israel-Training-Hamsa/sample-form/node_modules/#apollo/react-components/node_modules/tslib/tslib.html
/home/israel/Documents/Israel-Training-Hamsa/sample-form/node_modules/#apollo/react-hoc/node_modules/tslib/tslib.html
/home/israel/Documents/Israel-Training-Hamsa/sample-form/node_modules/#apollo/react-ssr/node_modules/tslib/tslib.html
/home/israel/Documents/Israel-Training-Hamsa/sample-form/node_modules/#shopify/polaris-tokens/node_modules/tslib/tslib.html
/home/israel/Documents/Israel-Training-Hamsa/sample-form/node_modules/apollo-boost/node_modules/tslib/tslib.html
/home/israel/Documents/Israel-Training-Hamsa/sample-form/node_modules/apollo-cache/node_modules/tslib/tslib.html
/home/israel/Documents/Israel-Training-Hamsa/sample-form/node_modules/apollo-cache-inmemory/node_modules/tslib/tslib.html
/home/israel/Documents/Israel-Training-Hamsa/sample-form/node_modules/apollo-client/node_modules/tslib/tslib.html
/home/israel/Documents/Israel-Training-Hamsa/sample-form/node_modules/react-apollo/node_modules/tslib/tslib.html
/home/israel/Documents/Israel-Training-Hamsa/sample-form/node_modules/tslib/tslib.html
/home/israel/Documents/sample-embedded-app/node_modules/tslib/tslib.html
/home/israel/Documents/sound-wave-image-generator/node_modules/tslib/tslib.html
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ecasound.rb
/snap/core/9436/usr/include/reglib/reglib.h
/snap/core/9665/usr/include/reglib/reglib.h
/snap/gnome-3-34-1804/24/usr/include/stdlib.h
/snap/gnome-3-34-1804/24/usr/include/zlib.h
/snap/gnome-3-34-1804/24/usr/include/X11/XKBlib.h
/snap/gnome-3-34-1804/24/usr/include/X11/Xlib.h
/snap/gnome-3-34-1804/24/usr/include/X11/ICE/ICElib.h
/snap/gnome-3-34-1804/24/usr/include/X11/SM/SMlib.h
/snap/gnome-3-34-1804/24/usr/include/c++/6/stdlib.h
/snap/gnome-3-34-1804/24/usr/include/c++/6/tr1/stdlib.h
/snap/gnome-3-34-1804/24/usr/include/cairo/cairo-xlib.h
/snap/gnome-3-34-1804/24/usr/include/dbus-1.0/dbus/dbus-glib.h
/snap/gnome-3-34-1804/24/usr/include/freetype2/freetype/config/ftstdlib.h
/snap/gnome-3-34-1804/24/usr/include/gdk-pixbuf-2.0/gdk-pixbuf-xlib/gdk-pixbuf-xlib.h
/snap/gnome-3-34-1804/24/usr/include/glib-2.0/glib.h
/snap/gnome-3-34-1804/24/usr/include/glib-2.0/glib/gi18n-lib.h
/snap/gnome-3-34-1804/24/usr/include/harfbuzz/hb-glib.h
/snap/gnome-3-34-1804/24/usr/include/libdbusmenu-glib-0.4/libdbusmenu-glib/dbusmenu-glib.h
/snap/gnome-3-34-1804/24/usr/include/linux/ultrasound.h
/snap/gnome-3-34-1804/24/usr/include/rpcsvc/nislib.h
/snap/gnome-3-34-1804/24/usr/include/sound/asound.h
/snap/gnome-3-34-1804/24/usr/include/sound/asound_fm.h
/snap/gnome-3-34-1804/24/usr/include/x86_64-linux-gnu/bits/stdlib.h
/snap/gnome-3-34-1804/24/usr/lib/x86_64-linux-gnu/libasound.so.2
/snap/gnome-3-34-1804/24/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0
/snap/gnome-3-34-1804/36/usr/include/stdlib.h
/snap/gnome-3-34-1804/36/usr/include/zlib.h
/snap/gnome-3-34-1804/36/usr/include/X11/XKBlib.h
/snap/gnome-3-34-1804/36/usr/include/X11/Xlib.h
/snap/gnome-3-34-1804/36/usr/include/X11/ICE/ICElib.h
/snap/gnome-3-34-1804/36/usr/include/X11/SM/SMlib.h
/snap/gnome-3-34-1804/36/usr/include/c++/6/stdlib.h
/snap/gnome-3-34-1804/36/usr/include/c++/6/tr1/stdlib.h
/snap/gnome-3-34-1804/36/usr/include/cairo/cairo-xlib.h
/snap/gnome-3-34-1804/36/usr/include/dbus-1.0/dbus/dbus-glib.h
/snap/gnome-3-34-1804/36/usr/include/freetype2/freetype/config/ftstdlib.h
/snap/gnome-3-34-1804/36/usr/include/gdk-pixbuf-2.0/gdk-pixbuf-xlib/gdk-pixbuf-xlib.h
/snap/gnome-3-34-1804/36/usr/include/glib-2.0/glib.h
/snap/gnome-3-34-1804/36/usr/include/glib-2.0/glib/gi18n-lib.h
/snap/gnome-3-34-1804/36/usr/include/harfbuzz/hb-glib.h
/snap/gnome-3-34-1804/36/usr/include/libdbusmenu-glib-0.4/libdbusmenu-glib/dbusmenu-glib.h
/snap/gnome-3-34-1804/36/usr/include/linux/ultrasound.h
/snap/gnome-3-34-1804/36/usr/include/rpcsvc/nislib.h
/snap/gnome-3-34-1804/36/usr/include/sound/asound.h
/snap/gnome-3-34-1804/36/usr/include/sound/asound_fm.h
/snap/gnome-3-34-1804/36/usr/include/x86_64-linux-gnu/bits/stdlib.h
/snap/gnome-3-34-1804/36/usr/lib/x86_64-linux-gnu/libasound.so.2
/snap/gnome-3-34-1804/36/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0
/snap/heroku/3962/node_modules/#heroku-cli/color/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-apps/node_modules/cli-ux/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-apps/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-auth/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-autocomplete/node_modules/#oclif/config/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-buildpacks/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-certs/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-ci/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-config/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-git/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-local/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-pipelines/node_modules/cli-ux/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-pipelines/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-ps/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-run/node_modules/cli-ux/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-run/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-status/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-webhooks/node_modules/cli-ux/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#heroku-cli/plugin-webhooks/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/color/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/command/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/config/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/parser/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/plugin-commands/node_modules/cli-ux/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/plugin-commands/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/plugin-help/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/plugin-legacy/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/plugin-not-found/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/plugin-plugins/node_modules/cli-ux/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/plugin-plugins/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/plugin-update/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/plugin-warn-if-update-available/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/#oclif/plugin-which/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/cli-ux/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/edit-string/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/heroku-cli-util/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/rxjs/node_modules/tslib/tslib.html
/snap/heroku/3962/node_modules/tslib/tslib.html
/snap/postman/118/usr/lib/x86_64-linux-gnu/libasound.so.2
/snap/postman/118/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0
/snap/postman/118/usr/share/Postman/resources/app/node_modules/tslib/tslib.html
/snap/postman/118/usr/share/doc/libasound2
/snap/postman/118/usr/share/doc/libasound2-data
/snap/postman/118/usr/share/doc/libasound2/NEWS.Debian.gz
/snap/postman/118/usr/share/doc/libasound2/changelog.Debian.gz
/snap/postman/118/usr/share/doc/libasound2/copyright
/snap/postman/118/usr/share/doc/libasound2/examples
/snap/postman/118/usr/share/doc/libasound2/examples/asoundrc.txt.gz
/snap/postman/118/usr/share/doc/libasound2-data/changelog.Debian.gz
/snap/postman/118/usr/share/doc/libasound2-data/copyright
/snap/postman/119/usr/lib/x86_64-linux-gnu/libasound.so.2
/snap/postman/119/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0
/snap/postman/119/usr/share/Postman/resources/app/node_modules/tslib/tslib.html
/snap/postman/119/usr/share/doc/libasound2
/snap/postman/119/usr/share/doc/libasound2-data
/snap/postman/119/usr/share/doc/libasound2/NEWS.Debian.gz
/snap/postman/119/usr/share/doc/libasound2/changelog.Debian.gz
/snap/postman/119/usr/share/doc/libasound2/copyright
/snap/postman/119/usr/share/doc/libasound2/examples
/snap/postman/119/usr/share/doc/libasound2/examples/asoundrc.txt.gz
/snap/postman/119/usr/share/doc/libasound2-data/changelog.Debian.gz
/snap/postman/119/usr/share/doc/libasound2-data/copyright
/snap/vlc/1700/usr/lib/x86_64-linux-gnu/libasound.so.2
/snap/vlc/1700/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0
/usr/include/asoundlib.h
/usr/include/stdlib.h
/usr/include/alsa/asoundef.h
/usr/include/alsa/asoundlib.h
/usr/include/alsa/sound/asound_fm.h
/usr/include/alsa/sound/uapi/asound_fm.h
/usr/include/c++/9/stdlib.h
/usr/include/c++/9/tr1/stdlib.h
/usr/include/linux/ultrasound.h
/usr/include/reglib/reglib.h
/usr/include/rpcsvc/nislib.h
/usr/include/sound/asound.h
/usr/include/sound/asound_fm.h
/usr/include/sys/asoundlib.h
/usr/include/x86_64-linux-gnu/bits/stdlib.h
/usr/lib/x86_64-linux-gnu/libasound.so
/usr/lib/x86_64-linux-gnu/libasound.so.2
/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_conf_pulse.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_ctl_arcam_av.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_ctl_oss.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_ctl_pulse.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_jack.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_oss.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_pulse.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_upmix.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_usb_stream.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_vdownmix.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_samplerate.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_samplerate_best.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_samplerate_linear.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_samplerate_medium.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_samplerate_order.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_speexrate.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_speexrate_best.so
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_speexrate_medium.so
Note: it works well on localhost, this only happen when i try to deploy on Heroku. Any help is appreciated. Thanks in advance.
I am doing a angular exercise where i have to do a e2e test, when I run the protractor protractor.conf.js i have the following errors:
[launcher] Running 1 instances of WebDriver
(node:3032) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108
var template = new Error(this.message);
^
SessionNotCreatedError: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"6904.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=59.0.3071.86)
(Driver info: chromedriver=2.19.346078 (6f1f0cde889532d48ce8242342d0b84f94b114a1),platform=Windows NT 10.0 x86_64)
at new bot.Error (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108:18)
at Object.bot.response.checkResponse (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:109:9)
at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:160:24
at promise.ControlFlow.runInFrame_ (C:/Users/Aurora/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1857:20)
at wrappedCtr.notify (C:/Users/Aurora/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2448:25)
at promise.Promise.notify_ (C:/Users/Aurora/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:564:12)
at Array.forEach (native)
at promise.Promise.notifyAll_ (C:/Users/Aurora/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:553:15)
at goog.async.run.processWorkQueue (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:130:15)
at <anonymous>
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:157:22)
at Function.webdriver.WebDriver.createSession (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:131:30)
at new Driver (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\chrome.js:810:36)
at DirectDriverProvider.getNewDriver (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\direct.js:68:16)
at Runner.createBrowser (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:182:37)
at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:263:21
at _fulfilled (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:797:54)
at self.promiseDispatch.done (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:826:30)
at Promise.promise.promiseDispatch (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:759:13)
at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:525:49
[launcher] Process exited with error code 1
Can anybody help me to figure out what's wrong?
I attach the file protractor.conf.js and the file that contain all the e2e tests that I execute on the application:
exports.config = {
allScriptsTimeout: 11000,
specs: [
'e2e/*.js'
],
capabilities: {
'browserName': 'chrome'
},
baseUrl: 'http://localhost:3001/',
framework: 'jasmine',
directConnect: true,
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
}
};
'use strict';
describe('conFusion App E2E Testing', function() {
//Introduce the tests into this file
it('should automatically redirect to / when location hash/fragment is empty', function() {
browser.get('index.html');
expect(browser.getLocationAbsUrl()).toMatch("/");
});
//Set up a simple test for the index file to check if the page title is set correctly
describe('index', function() {
beforeEach(function() {
browser.get('index.html#/');
});
it('should have a title', function() {
expect(browser.getTitle()).
toEqual('Ristorante Con Fusion');
});
});
//We will navigate to the first menu item, and test a few properties there
describe('menu 0 item', function() {
beforeEach(function() {
browser.get('index.html#/menu/0');
});
it('should have a name', function() {
var name = element(by.binding('dish.name'));
expect(name.getText()).
toEqual('Uthapizza Hot $4.99');
});
it('should show the number of comments as', function() {
expect(element.all(by.repeater('comment in dish.comments'))
.count()).toEqual(7);
});
it('should show the first comment author as', function() {
element(by.model('critiria')).sendKeys('author');
expect(element.all(by.repeater('comment in dish.comments'))
.count()).toEqual(7);
var author = element.all(by.repeater('comment in dish.comments'))
.first().element(by.binding('comment.author'));
expect(author.getText()).toContain('25 Cent');
});
});
});
For a reason below, I've added Chromedriver Web Version 2.19 again and installed
Chrome version 44, I always get an error:
C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:172 callback(new Error(message)); ^ Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:55368 at ClientRequest.
<anonymous> (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:172:16) at emitOne (events.js:115:13) at ClientRequest.emit (events.js:210:7) at Socket.socketErrorListener (_http_client.js:399:9) at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7) at emitErrorNT (internal/streams/destroy.js:62:8) at _combinedTickCallback (internal/process/next_tick.js:102:11) at process._tickCallback (internal/process/next_tick.js:161:9) From: Task: WebDriver.createSession() at
Function.webdriver.WebDriver.acquireSession_ (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:157:22) at Function.webdriver.WebDriver.createSession (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:131:30)
at new Driver (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\chrome.js:810:36) at DirectDriverProvider.getNewDriver (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\direct.js:68:16)
at Runner.createBrowser (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:182:37) at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:263:21 at _fulfilled (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:797:54)
at self.promiseDispatch.done (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:826:30) at Promise.promise.promiseDispatch (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:759:13) at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:525:49
[launcher] Process exited with error code 1
You are using:
Chromedriver version 2.19
Chrome version 59
These two are not compatible - you need ChromeDriver 2.30 to work with Chrome 59:
Latest Release: ChromeDriver 2.30
Supports Chrome v58-60
Update your ChromeDriver. Typically done via:
webdriver-manager update
I have the below es6 class which is in mqttModule.js.
/*jshint esversion: 6*/
import mqtt from 'mqtt';
let client;
class MqttWrapper {
constructor(mqttOptions) {
this.clientId = mqttOptions.clientId;
this.keepAlive = mqttOptions.keepAlive;
this.clean = mqttOptions.clean;
this.reconnectPeriod = mqttOptions.reconnectPeriod;
this.will = mqttOptions.lastWillMessage;
let options = {
clientId: this.clientId,
keepAlive: this.keepAlive,
clean: this.clean,
reconnectPeriod: this.reconnectPeriod,
will: this.will
};
client = mqtt.connect(url, options);
}
}
export {MqttWrapper};
and I am calling it as shown below.
import MqttWrapper from './mqttModule'
let willMessage = {
topic : 'WillMessage',
payload : 'This is the last will message',
qos : 2,
retain : 'true'
}
let mqttOptions = {
clientId : '101',
keepAlive : 10,
clean : 'false',
reconnectPeriod : '1000',
lastWillMessage : willMessage
}
let mqttWrapperObj = new MqttWrapper(mqttOptions);
When I run the gulp command it transpiles fine without any errors. But when I run it, I am getting the error saying type error. Below is the full trace.
G:\Projects\Kube2\edge-node-sdk-js-test\src\app.js:25
var mqttWrapperObj = new _mqttModule2.default(mqttOptions);
^
TypeError: _mqttModule2.default is not a function
at Object.<anonymous> (app.js:19:22)
at Module._compile (module.js:409:26)
at loader (G:\Projects\Kube2\edge-node-sdk-js-test\node_modules\babel-cli\no
de_modules\babel-register\lib\node.js:158:5)
at Object.require.extensions.(anonymous function) [as .js] (G:\Projects\Kube
2\edge-node-sdk-js-test\node_modules\babel-cli\node_modules\babel-register\lib\n
ode.js:168:7)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at G:\Projects\Kube2\edge-node-sdk-js-test\node_modules\babel-cli\lib\_babel
-node.js:171:48
at Object.<anonymous> (G:\Projects\Kube2\edge-node-sdk-js-test\node_modules\
babel-cli\lib\_babel-node.js:172:7)
at Module._compile (module.js:409:26)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v4.4.4
npm ERR! npm v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! edge-node-sdk-js-test#1.0.0 start: `babel-node --presets es2015 ./src/a
pp.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the edge-node-sdk-js-test#1.0.0 start script 'babel-node --pr
esets es2015 ./src/app.js'.
npm ERR! This is most likely a problem with the edge-node-sdk-js-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! babel-node --presets es2015 ./src/app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs edge-node-sdk-js-test
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls edge-node-sdk-js-test
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! G:\Projects\Kube2\edge-node-sdk-js-test\npm-debug.log
Below is my gulp file just incase.
/*jshint esversion: 6 */
const gulp = require('gulp');
const babel = require('gulp-babel');
gulp.task('es6',() => {
return gulp.src('src/app.js')
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest('build'));
});
gulp.task('default',['es6'],() => {
gulp.watch('src/app.js',['es6'])
});
And below is the transpiled app.js file that gets created when I run the gulp command.
'use strict';
var _mqttModule = require('./mqttModule');
var _mqttModule2 = _interopRequireDefault(_mqttModule);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var willMessage = {
topic: 'WillMessage',
payload: 'This is the last will message',
qos: 2,
retain: 'true'
}; /*jshint esversion: 6*/
var mqttOptions = {
clientId: '101',
keepAlive: 10,
clean: 'false',
reconnectPeriod: '1000',
lastWillMessage: willMessage
};
var mqttWrapperObj = new _mqttModule2.default(mqttOptions);
I am new to ES6 and babel stuff. Please advice.