discord / erlpack

High Performance Erlang Term Format Packer
MIT License
217 stars 64 forks source link

Can't update via npm, "Permission denied" #14

Closed dylanh724 closed 5 years ago

dylanh724 commented 6 years ago

As part of Discord.js npm package, the followig is included as a dependency in package.json:

"erlpack": "github:hammerandchisel/erlpack"

However, when I npm update, I get permission denied.

sudo npm update

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN discord.js@11.2.1 requires a peer of bufferutil@^3.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.2.1 requires a peer of node-opus@^0.2.6 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.2.1 requires a peer of opusscript@^0.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.2.1 requires a peer of sodium@^2.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.2.1 requires a peer of libsodium-wrappers@^0.5.4 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 72 packages, removed 36 packages and updated 58 packages in 22.382s
blah@api:~/tol-node-public/tol2-test$ sudo npm update --save
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone -q git://github.com/hammerandchisel/erlpack.git /home/blah/.npm/_cacache/tmp/git-clone-d93fd496
npm ERR! /home/blah/.npm/_cacache/tmp/git-clone-d93fd496/.git: Permission denied

The logs show this:

340 silly fetchPackageMetaData error for github:hammerandchisel/erlpack Command failed: /usr/bin/git clone -q git://github.com/hammerandchisel/erlpack.git /home/blah/.npm/_cacache/tmp/git-
340 silly fetchPackageMetaData /home/blah/.npm/_cacache/tmp/git-clone-98357cbf/.git: Permission denied
341 verbose stack Error: Command failed: /usr/bin/git clone -q git://github.com/hammerandchisel/erlpack.git /home/blah/.npm/_cacache/tmp/git-clone-98357cbf
341 verbose stack /home/blah/.npm/_cacache/tmp/git-clone-98357cbf/.git: Permission denied
341 verbose stack
341 verbose stack     at ChildProcess.exithandler (child_process.js:205:12)
341 verbose stack     at emitTwo (events.js:106:13)
341 verbose stack     at ChildProcess.emit (events.js:194:7)
341 verbose stack     at maybeClose (internal/child_process.js:899:16)
341 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
342 verbose cwd /home/blah/tol-node-public/tol2-test
343 verbose Linux 3.13.0-77-generic
344 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "update"
345 verbose node v7.10.0
346 verbose npm  v5.6.0
347 error code 1
348 error Command failed: /usr/bin/git clone -q git://github.com/hammerandchisel/erlpack.git /home/blah/.npm/_cacache/tmp/git-clone-98357cbf
348 error /home/blah/.npm/_cacache/tmp/git-clone-98357cbf/.git: Permission denied
349 verbose exit [ 1, true ]
dylanh724 commented 6 years ago

To add, if I remove this package dependency, I can install, update, do anything.

If I add it back, this continues.

As an update, I also renamed the old package to the newer one discordapp/ instead of hammerandchisel/, but the same thing happens~

SEAPUNK commented 6 years ago

looks like an npm bug, having to do with file permissions

try using yarn to install

mbrutsch commented 5 years ago

Thanks. SEAPUNK. Now I know when setup_8.x tells you to install yarn, it means you should use it as well.

2 days, this was my last error, yarn likely would have avoided all the npm permission grief.

Thanks again.