keybase-issues icon indicating copy to clipboard operation
keybase-issues copied to clipboard

`keybase update` fails

Open cipherself opened this issue 11 years ago • 11 comments

I tried to update via keybase update and it failed sending this to standard output

info: Computed npm install prefix: /usr
info: Found keybase-installer: keybase-installer v1.0.0
info: Using default npm install prefix
info: Attempting software upgrade.....
info: Running `keybase-installer -g gpg2`
npm ERR! version Bad package.json data undefined
npm ERR! Linux 3.17.6-1-ARCH
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "version"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.14

npm ERR! Unexpected token u
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/skeuomorf/npm-debug.log
error: Couldn't find an `npm` command in your path
error: exit code 254

These are the contents of npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'version' ]
2 info using [email protected]
3 info using [email protected]
4 verbose config Skipping project config: /home/skeuomorf/.npmrc. (matches userconfig)
5 error version Bad package.json data undefined
6 verbose type unexpected_token
7 verbose stack SyntaxError: Unexpected token u
7 verbose stack     at Object.parse (native)
7 verbose stack     at /usr/lib/node_modules/npm/lib/version.js:36:19
7 verbose stack     at evalmachine.<anonymous>:207:20
7 verbose stack     at OpenReq.Req.done (/usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:141:5)
7 verbose stack     at OpenReq.done (/usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:61:22)
7 verbose stack     at Object.oncomplete (evalmachine.<anonymous>:107:15)
8 verbose cwd /home/skeuomorf
9 error Linux 3.17.6-1-ARCH
10 error argv "/usr/bin/node" "/usr/bin/npm" "version"
11 error node v0.10.33
12 error npm  v2.1.14
13 error Unexpected token u
14 error If you need help, you may report this error at:
14 error     <http://github.com/npm/npm/issues>
15 verbose exit [ 1, true ]

I imagine this might be related to https://github.com/npm/npm/issues/6247 since keybase-installer runs as keybase-installer -g pkg?

npm is already available on my $PATH, OS is Arch Linux running kernel 3.17.6-1

cipherself avatar Dec 16 '14 16:12 cipherself

I am closing this as the lastest node update fixes it.

cipherself avatar Dec 19 '14 16:12 cipherself

I'm having this issue with the latest Node (v0.10.34) and npm (v2.1.16).

s4y avatar Dec 23 '14 04:12 s4y

Reopening as I can confirm that the problem still exists, using Node version 0.10.34 and npm version 2.1.15.

cipherself avatar Dec 23 '14 08:12 cipherself

I can confirm this issue as well:

> keybase update
info: Attempting software upgrade.....
npm ERR! version Bad package.json data undefined
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "version"
npm ERR! node v0.10.35
npm ERR! npm  v2.1.14

npm ERR! Unexpected token u
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/local/bin/npm-debug.log
error: Couldn't find an `npm` command in your path
error: exit code 254

Yggdrasil avatar Dec 28 '14 16:12 Yggdrasil

Try:

npm install -g keybase-installer

And redo it On Dec 28, 2014 11:25 AM, "Martijn Heemels" [email protected] wrote:

I can confirm this issue as well:

keybase update info: Attempting software upgrade..... npm ERR! version Bad package.json data undefined npm ERR! Darwin 14.0.0 npm ERR! argv "node" "/usr/local/bin/npm" "version" npm ERR! node v0.10.35 npm ERR! npm v2.1.14

npm ERR! Unexpected token u npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! http://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! /usr/local/bin/npm-debug.log error: Couldn't find an npm command in your path error: exit code 254

— Reply to this email directly or view it on GitHub https://github.com/keybase/keybase-issues/issues/1265#issuecomment-68211552 .

maxtaco avatar Dec 28 '14 16:12 maxtaco

Unfortunately that command fails as well:

> npm install -g keybase-installer 
npm ERR! not a package /usr/local/bin/keybase-installer
npm ERR! addLocal Could not install /usr/local/bin/keybase-installer
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "keybase-installer"
npm ERR! node v0.10.35
npm ERR! npm  v2.1.14
npm ERR! path /var/folders/d5/ll2jjm6s6cz1xpzhqjy2kw6m0000gn/T/npm-16533-6cfc9f96/unpack-b7925f725dea/package.json
npm ERR! code ENOENT
npm ERR! errno 34

npm ERR! enoent ENOENT, open '/var/folders/d5/ll2jjm6s6cz1xpzhqjy2kw6m0000gn/T/npm-16533-6cfc9f96/unpack-b7925f725dea/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/local/bin/npm-debug.log

Yggdrasil avatar Dec 28 '14 16:12 Yggdrasil

Hmm, after rm -rf ~/.npm the npm install command is now working and the keybase update succeeded as well! It appears my npm environment was messed up.

Thanks for pointing me in the right direction.

Yggdrasil avatar Dec 28 '14 16:12 Yggdrasil

Well, npm install -g keybase-installer fails for me as well as keybase update even after cleaning the npm cache i.e. the ~/.npm folder.

cipherself avatar Dec 28 '14 16:12 cipherself

Can provide logs and error messages if needed.

cipherself avatar Dec 28 '14 16:12 cipherself

Hi @skeuomorf, that would help. I can't currently reproduce your errors. It might be a permissions problem. Thanks.

maxtaco avatar Dec 28 '14 23:12 maxtaco

Hey @maxtaco, you're spot on, it was a permissions problem (my mistake), I forgot to give npm install -g keybase-installer sudo permissions. Thanks for your time :)

For anyone else who might encounter this problem:

  • run sudo npm-install -g keybase-installer
  • run sudo keybase update and it should work correctly.

Closing the issue as this is no longer reproducible.

cipherself avatar Dec 28 '14 23:12 cipherself