GoogleChromeLabs/ndb

Failed to install ndb

terapackets opened this issue ยท 17 comments

Steps to reproduce

jsmith@jsmith-hp1:~/projs/$ sudo npm install -g ndb
/usr/bin/ndb -> /usr/lib/node_modules/ndb/ndb.js

> deasync@0.1.13 install /usr/lib/node_modules/ndb/node_modules/deasync
> node ./build.js

`linux-x64-node-8` exists; testing
Binary is fine; exiting

> node-pty-prebuilt@0.7.3 install /usr/lib/node_modules/ndb/node_modules/node-pty-prebuilt
> prebuild-install || node scripts/install.js

prebuild-install WARN install EACCES: permission denied, mkdir '/usr/lib/node_modules/ndb/node_modules/node-pty-prebuilt/build'
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/ndb/node_modules/node-pty-prebuilt/build'
gyp ERR! System Linux 3.19.0-65-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/ndb/node_modules/node-pty-prebuilt
gyp ERR! node -v v8.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

Tell us about your environment:

  • ndb version: n/a (initial installation)
  • Platform / OS version: ubuntu 14.04 64bit.
  • Node.js version: 8.4.0

What steps will reproduce the problem?

Seeing the error mkdir '/usr/lib/node_modules/ndb/node_modules/node-pty-prebuilt/build', I tried to
manually created directory '/usr/lib/node_modules/ndb/node_modules/node-pty-prebuilt/' but I got the same error when I tried to install it again.

What is the expected result?

What happens instead?

I failed to install ndb either.

node -v
v8.11.3
npm -v
5.6.0

`
lily:~ $ sudo npm install -g ndb
Password:
/usr/local/bin/ndb -> /usr/local/lib/node_modules/ndb/ndb.js

deasync@0.1.13 install /usr/local/lib/node_modules/ndb/node_modules/deasync
node ./build.js

darwin-x64-node-8 exists; testing
Binary is fine; exiting

node-pty-prebuilt@0.7.3 install /usr/local/lib/node_modules/ndb/node_modules/node-pty-prebuilt
prebuild-install || node scripts/install.js

prebuild-install WARN install EACCES: permission denied, access '/Users/lily/.npm'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/ndb/node_modules/node-pty-prebuilt/build'
gyp ERR! System Darwin 18.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/ndb/node_modules/node-pty-prebuilt
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

puppeteer@1.6.0 install /usr/local/lib/node_modules/ndb/node_modules/puppeteer
node install.js

ERROR: Failed to download Chromium r571375! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/ndb/node_modules/puppeteer/.local-chromium'
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/usr/local/lib/node_modules/ndb/node_modules/puppeteer/.local-chromium' }
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-pty-prebuilt@0.7.3 (node_modules/ndb/node_modules/node-pty-prebuilt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-pty-prebuilt@0.7.3 install: prebuild-install || node scripts/install.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer@1.6.0 install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the puppeteer@1.6.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/lily/.npm/_logs/2018-07-23T01_31_34_361Z-debug.log
`

i meet this problem either

Some installation problems may be resolved in just published 1.0.8 but I am still looking into this problem.

Encountering the same on 1.0.8 (Ubuntu 16.04.4)

I see this as well:

$ node --version
v10.7.0

$ npm --version
6.2.0

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.13.6
BuildVersion:	17G65

Installed node using official package installer.

Some permissions related problems are highlighted in following thread: puppeteer/puppeteer#375
I will check how it works with official Node.js installer by myself as well.

Thanks, worked for me with --unsafe-perm=true

sudo npm install -g ndb --unsafe-perm=true --allow-root ftw

when I run ndb node xxx.js,it can't work.Here is the error message.
(node:45413) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Chromium revision is not downloaded. Run "npm install" or "yarn install"
(node:45413) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

wnm3 commented

@raskanskyz solution to use:
sudo npm install -g ndb --unsafe-perm=true --allow-root ftw
solved my problems on MacOS install of ndb

wnm3MacBook:wild wnm3$ node --version
v8.11.2
wnm3MacBook:wild wnm3$ npm --version
5.6.0
wnm3MacBook:wild wnm3$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.13.6
BuildVersion:	17G65

details showing example failure followed by working solution:

wnm3MacBook:wild wnm3$ sudo npm install -g ndb
/usr/local/bin/ndb -> /usr/local/lib/node_modules/ndb/ndb.js

> deasync@0.1.13 install /usr/local/lib/node_modules/ndb/node_modules/deasync
> node ./build.js

`darwin-x64-node-8` exists; testing
Binary is fine; exiting

> ndb-node-pty-prebuilt@0.8.0 install /usr/local/lib/node_modules/ndb/node_modules/ndb-node-pty-prebuilt
> node scripts/install.js

(node:79147) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/ndb/node_modules/ndb-node-pty-prebuilt/build'
(node:79147) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:79147) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

> puppeteer@1.6.1 install /usr/local/lib/node_modules/ndb/node_modules/puppeteer
> node install.js

ERROR: Failed to download Chromium r575458! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/ndb/node_modules/puppeteer/.local-chromium'
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/usr/local/lib/node_modules/ndb/node_modules/puppeteer/.local-chromium' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer@1.6.1 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the puppeteer@1.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/wnm3/.npm/_logs/2018-07-26T15_38_06_781Z-debug.log

removed and then used his solution:

wnm3MacBook:wild wnm3$ sudo npm remove -g ndb
up to date in 0.045s

wnm3MacBook:wild wnm3$ sudo npm install -g ndb --unsafe-perm=true --allow-root ftw
/usr/local/bin/ndb -> /usr/local/lib/node_modules/ndb/ndb.js

> deasync@0.1.13 install /usr/local/lib/node_modules/ndb/node_modules/deasync
> node ./build.js

`darwin-x64-node-8` exists; testing
Binary is fine; exiting

> ndb-node-pty-prebuilt@0.8.0 install /usr/local/lib/node_modules/ndb/node_modules/ndb-node-pty-prebuilt
> node scripts/install.js


> puppeteer@1.6.1 install /usr/local/lib/node_modules/ndb/node_modules/puppeteer
> node install.js

Downloading Chromium r575458 - 80.4 Mb [====================] 100% 0.0s 
Chromium downloaded to /usr/local/lib/node_modules/ndb/node_modules/puppeteer/.local-chromium/mac-575458

> ndb-node-pty-prebuilt@0.8.0 postinstall /usr/local/lib/node_modules/ndb/node_modules/ndb-node-pty-prebuilt
> node scripts/post-install.js


> ndb@1.0.11 postinstall /usr/local/lib/node_modules/ndb
> node install.js

+ ndb@1.0.11
+ ftw@0.0.1
added 169 packages in 15.75s

I used the command sudo npm install -g ndb --unsafe-perm=true --allow-root and it works well for me. So close this ticket. Thanks everyone!

Adding the previously mentioned additional cli args worked for me on Ubuntu 18.04. It would be nice if the README was updated to include this information.

result of run commnad: sudo npm install -g ndb --unsafe-perm=true --allow-root ftw (failed)

image

result of run comand: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 sudo npm install -g ndb --unsafe-perm=true --allow-root ftw (success)

image

I dont know why, but with PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 set, chromium being downloaded successful.

node version: 10.7.0
npm version: 6.2.0
os: mac

@aslushnikov what do you think about last comment?

what is ftw that people add in the last command?

it shows nothing here
https://www.npmjs.com/package/ftw

is that wrong command ???

result of run commnad: sudo npm install -g ndb --unsafe-perm=true --allow-root ftw (failed)

sudo npm install -g ndb --unsafe-perm=true --allow-root ftw

This is a permissions issue.

If I run PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 sudo npm install -g ndb --unsafe-perm=true --allow-root to install ndb and then run ndb >>MY COMMAND<< then Chromium downloads and everything works.

what is ftw that people add in the last command?

for anyone that is confused, ftw = for the win. It is not meant to be part of the cmd line args. it should be just: sudo npm install -g ndb --unsafe-perm=true --allow-root