Failed to run ndb globally
Author: thinh105Created Oct 12, 2019Updated May 20, 2023
I try every command in this topic https://github.com/GoogleChromeLabs/ndb/issues/20 but the error still happens
Cannot run the ndb command globally, It's working fine in dev mode
Install global
~/myProjects/Node/cat mouse$ sudo npm install -g ndb --unsafe-perm=true --allow-root
/usr/bin/ndb -> /usr/lib/node_modules/ndb/ndb.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/ndb/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ [email protected]
updated 1 package in 5.838sRun Global
~/myProjects/Node/cat mouse$ ndb mouse.js
Downloading Chromium r624492...
ERROR: Failed to download Chromium r624492!
Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/ndb/node_modules/carlo/lib/.local-data'
-- ASYNC --
at BrowserFetcher.<anonymous> (/usr/lib/node_modules/ndb/node_modules/puppeteer-core/lib/helper.js:108:27)
at downloadChromium (/usr/lib/node_modules/ndb/node_modules/carlo/lib/find_chrome.js:194:50)
at findChrome (/usr/lib/node_modules/ndb/node_modules/carlo/lib/find_chrome.js:241:32)
at Object.launch (/usr/lib/node_modules/ndb/node_modules/carlo/lib/carlo.js:594:42)
at launch (/usr/lib/node_modules/ndb/lib/launcher.js:23:23)
at Object.<anonymous> (/usr/lib/node_modules/ndb/ndb.js:35:1)
at Module._compile (internal/modules/cjs/loader.js:945:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:962:10)
at Module.load (internal/modules/cjs/loader.js:798:32)
at Function.Module._load (internal/modules/cjs/loader.js:711:12) {
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/usr/lib/node_modules/ndb/node_modules/carlo/lib/.local-data'
}
unhandledRejection TypeError: Cannot read property 'executablePath' of null
at findChrome (/usr/lib/node_modules/ndb/node_modules/carlo/lib/find_chrome.js:242:43)
at async Object.launch (/usr/lib/node_modules/ndb/node_modules/carlo/lib/carlo.js:594:36)
at async launch (/usr/lib/node_modules/ndb/lib/launcher.js:23:11)
Remove and try to reinstall again
~/myProjects/Node/cat mouse$ sudo npm uninstall -g ndb
~/myProjects/Node/cat mouse$ removed 143 packages in 1.124s
~/myProjects/Node/cat mouse$ sudo npm install -g ndb --unsafe-perm=true --allow-root
/usr/bin/ndb -> /usr/lib/node_modules/ndb/ndb.js
> [email protected] install /usr/lib/node_modules/ndb/node_modules/puppeteer-core
> node install.js
> [email protected] install /usr/lib/node_modules/ndb/node_modules/node-pty
> node scripts/install.js
make: Entering directory '/usr/lib/node_modules/ndb/node_modules/node-pty/build'
CXX(target) Release/obj.target/pty/src/unix/pty.o
../src/unix/pty.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE PtyFork(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/unix/pty.cc:195:53: warning: ‘v8::Maybe<bool> v8::Value::BooleanValue(v8::Local<v8::Context>) const’ is deprecated: BooleanValue can never throw. Use Isolate version. [-Wdeprecated-declarations]
if (info[8]->BooleanValue(Nan::GetCurrentContext()).FromJust()) {
^
In file included from /home/bastian/.cache/node-gyp/12.11.1/include/node/v8-internal.h:14:0,
from /home/bastian/.cache/node-gyp/12.11.1/include/node/v8.h:25,
from /home/bastian/.cache/node-gyp/12.11.1/include/node/node.h:63,
from ../../nan/nan.h:54,
from ../src/unix/pty.cc:20:
/home/bastian/.cache/node-gyp/12.11.1/include/node/v8.h:2606:51: note: declared here
V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
^
/home/bastian/.cache/node-gyp/12.11.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
../src/unix/pty.cc: In function ‘void pty_after_waitpid(uv_async_t*)’:
../src/unix/pty.cc:495:69: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
Nan::Callback(cb).Call(Nan::GetCurrentContext()->Global(), 2, argv);
^
In file included from ../src/unix/pty.cc:20:0:
../../nan/nan.h:1718:3: note: declared here
Call(v8::Local<v8::Object> target
^~~~
SOLINK_MODULE(target) Release/obj.target/pty.node
COPY Release/pty.node
make: Leaving directory '/usr/lib/node_modules/ndb/node_modules/node-pty/build'
> [email protected] postinstall /usr/lib/node_modules/ndb/node_modules/node-pty
> node scripts/post-install.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/ndb/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ [email protected]
added 143 packages from 68 contributors in 8.737s
~/myProjects/Node/cat mouse$ ndb test.js
Downloading Chromium r624492...
ERROR: Failed to download Chromium r624492!
Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/ndb/node_modules/carlo/lib/.local-data'
-- ASYNC --
at BrowserFetcher.<anonymous> (/usr/lib/node_modules/ndb/node_modules/puppeteer-core/lib/helper.js:108:27)
at downloadChromium (/usr/lib/node_modules/ndb/node_modules/carlo/lib/find_chrome.js:194:50)
at findChrome (/usr/lib/node_modules/ndb/node_modules/carlo/lib/find_chrome.js:241:32)
at Object.launch (/usr/lib/node_modules/ndb/node_modules/carlo/lib/carlo.js:594:42)
at launch (/usr/lib/node_modules/ndb/lib/launcher.js:23:23)
at Object.<anonymous> (/usr/lib/node_modules/ndb/ndb.js:35:1)
at Module._compile (internal/modules/cjs/loader.js:945:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:962:10)
at Module.load (internal/modules/cjs/loader.js:798:32)
at Function.Module._load (internal/modules/cjs/loader.js:711:12) {
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/usr/lib/node_modules/ndb/node_modules/carlo/lib/.local-data'
}
unhandledRejection TypeError: Cannot read property 'executablePath' of null
at findChrome (/usr/lib/node_modules/ndb/node_modules/carlo/lib/find_chrome.js:242:43)
at async Object.launch (/usr/lib/node_modules/ndb/node_modules/carlo/lib/carlo.js:594:36)
at async launch (/usr/lib/node_modules/ndb/lib/launcher.js:23:11)
Try with sudo ndb test.js - still throwed error
sudo ndb test.js
Downloading Chromium r624492...
Chromium downloaded to /usr/lib/node_modules/ndb/node_modules/carlo/lib/.local-data/linux-624492
events.js:187
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at Pipe.onStreamRead (internal/stream_base_commons.js:201:27)
Emitted 'error' event on Socket instance at:
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'ECONNRESET',
code: 'ECONNRESET',
syscall: 'read'
}
One more time trying
~/myProjects/Node/catmouse$ ndb test.js
events.js:187
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at Pipe.onStreamRead (internal/stream_base_commons.js:201:27)
Emitted 'error' event on Socket instance at:
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'ECONNRESET',
code: 'ECONNRESET',
syscall: 'read'
}
Steps to reproduce
sudo npm install -g ndb --unsafe-perm=true --allow-root
ndb mouse.js
sudo ndb test.jsTell us about your environment:
- ndb version: v1.1.5
- Platform / OS version: ubuntu 18.04
- Node.js version: v12.11.1
Source: GoogleChromeLabs/ndb