Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Error running sudo npm install -g yo #10007

Closed
SurferJeffAtGoogle opened this issue Oct 16, 2015 · 4 comments
Closed

Error running sudo npm install -g yo #10007

SurferJeffAtGoogle opened this issue Oct 16, 2015 · 4 comments

Comments

@SurferJeffAtGoogle
Copy link

...
npm http GET https://registry.npmjs.org/spdx-license-ids
npm http GET https://registry.npmjs.org/spdx-exceptions
npm http GET https://registry.npmjs.org/spdx-license-ids
npm http GET https://registry.npmjs.org/balanced-match
npm http GET https://registry.npmjs.org/concat-map/0.0.1

spawn-sync@1.0.13 postinstall /usr/local/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync
node postinstall

npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm http 200 https://registry.npmjs.org/spdx-license-ids
npm http GET https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.0.2.tgz
npm http 200 https://registry.npmjs.org/spdx-exceptions
npm http 200 https://registry.npmjs.org/spdx-license-ids
npm http 200 https://registry.npmjs.org/balanced-match
npm http 200 https://registry.npmjs.org/concat-map/0.0.1
npm http GET https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.3.tgz
npm http 200 https://registry.npmjs.org/mute-stream/0.0.4
npm http GET https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz
npm ERR! Error: ENOENT, chown '/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/request/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com

npm ERR! System Linux 3.13.0-63-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /usr/local/google/home/rennie/vscode/hello
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/yo/node_modules/insight/node_modules/request/package.json
npm ERR! fstream_path /usr/local/lib/node_modules/yo/node_modules/insight/node_modules/request/package.json
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chown
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:305:19
npm ERR! fstream_stack /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/async'
npm ERR! error rolling back yo@1.4.8 { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/async']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/async' }
npm ERR! weird error 1
npm ERR! EEXIST, mkdir '/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/lodash.debounce'
File exists: /usr/local/lib/node_modules/yo/node_modules/insight/node_modules/lodash.debounce
Move it away, and try again.

npm ERR! System Linux 3.13.0-63-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /usr/local/google/home/rennie/vscode/hello
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/yo/node_modules/insight/node_modules/lodash.debounce
npm ERR! fstream_path /usr/local/lib/node_modules/yo/node_modules/insight/node_modules/lodash.debounce/README.md
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/lib/nodejs/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! EEXIST, mkdir '/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/tough-cookie'
File exists: /usr/local/lib/node_modules/yo/node_modules/insight/node_modules/tough-cookie
Move it away, and try again.

npm ERR! System Linux 3.13.0-63-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /usr/local/google/home/rennie/vscode/hello
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/yo/node_modules/insight/node_modules/tough-cookie
npm ERR! fstream_path /usr/local/lib/node_modules/yo/node_modules/insight/node_modules/tough-cookie/.npmignore
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/lib/nodejs/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, open '/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/inquirer/README.md'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com

npm ERR! System Linux 3.13.0-63-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /usr/local/google/home/rennie/vscode/hello
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/yo/node_modules/insight/node_modules/inquirer/README.md
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! Error: ENOENT, open '/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/object-assign/index.js'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com

npm ERR! System Linux 3.13.0-63-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /usr/local/google/home/rennie/vscode/hello
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/yo/node_modules/insight/node_modules/object-assign/index.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! Error: ENOENT, open '/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/os-name/cli.js'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com

npm ERR! System Linux 3.13.0-63-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /usr/local/google/home/rennie/vscode/hello
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/yo/node_modules/insight/node_modules/os-name/cli.js
npm ERR! code ENOENT
npm ERR! errno 34
npm http GET https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/yo/node_modules/package-json/node_modules/got/node_modules/duplexify/node_modules/readable-stream/readable.js'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com

npm ERR! System Linux 3.13.0-63-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /usr/local/google/home/rennie/vscode/hello
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/yo/node_modules/package-json/node_modules/got/node_modules/duplexify/node_modules/readable-stream/readable.js
npm ERR! fstream_path /usr/local/lib/node_modules/yo/node_modules/package-json/node_modules/got/node_modules/duplexify/node_modules/readable-stream/readable.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http GET https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz
npm http 200 https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.0.2.tgz
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/yo/node_modules/npm-keyword/node_modules/got/node_modules/duplexify/node_modules/readable-stream/node_modules/core-util-is/README.md'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com

npm ERR! System Linux 3.13.0-63-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /usr/local/google/home/rennie/vscode/hello
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/yo/node_modules/npm-keyword/node_modules/got/node_modules/duplexify/node_modules/readable-stream/node_modules/core-util-is/README.md
npm ERR! fstream_path /usr/local/lib/node_modules/yo/node_modules/npm-keyword/node_modules/got/node_modules/duplexify/node_modules/readable-stream/node_modules/core-util-is/README.md
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! tar pack Error reading /root/tmp/npm-32072-Ev5pR84v/1445033893671-0.5023446781560779/package
npm ERR! addLocalDirectory Could not pack "/root/tmp/npm-32072-Ev5pR84v/1445033893671-0.5023446781560779/package" to "/root/.npm/twig/0.8.2/package.tgz"
npm ERR! Error: ENOENT, lstat '/root/tmp/npm-32072-Ev5pR84v/1445033895982-0.14545395667664707/package/dist/rx.js'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com

npm ERR! System Linux 3.13.0-63-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /usr/local/google/home/rennie/vscode/hello
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /root/tmp/npm-32072-Ev5pR84v/1445033895982-0.14545395667664707/package/dist/rx.js
npm ERR! fstream_path /root/tmp/npm-32072-Ev5pR84v/1445033895982-0.14545395667664707/package/dist/rx.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http 200 https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.3.tgz
npm http 200 https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz
npm ERR! tar pack Error reading /root/tmp/npm-32072-Ev5pR84v/1445033895217-0.7655164864845574/package
npm ERR! addLocalDirectory Could not pack "/root/tmp/npm-32072-Ev5pR84v/1445033895217-0.7655164864845574/package" to "/root/.npm/lodash/2.4.2/package.tgz"
npm http 200 https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz
npm http 200 https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz
npm http GET https://registry.npmjs.org/core-util-is
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/isarray/0.0.1
npm http GET https://registry.npmjs.org/process-nextick-args
npm http GET https://registry.npmjs.org/string_decoder
npm http GET https://registry.npmjs.org/util-deprecate
npm http 304 https://registry.npmjs.org/isarray/0.0.1
npm http 304 https://registry.npmjs.org/string_decoder
npm http 304 https://registry.npmjs.org/core-util-is
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/util-deprecate
npm http 304 https://registry.npmjs.org/process-nextick-args
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/local/google/home/rennie/vscode/hello/npm-debug.log
npm ERR! not ok code 0

@kenany
Copy link
Contributor

kenany commented Oct 16, 2015

@SurferJeffAtGoogle Couple things:

  • npm@1.3 support ended years ago
  • The Node.js binary on your system is called nodejs instead of the expected node (you can see from the log how spawn-sync's postinstall script is trying to call node. This rename was a decision made by Debian maintainers. You should read this file that's in your system:
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

@SurferJeffAtGoogle
Copy link
Author

Scripts calling Node.js as a shell command must be changed to instead
use the "nodejs" command.

I read this file. But I haven't written any scripts that call nodejs. And I never type it at a command line, so I don't see how it's related.

I downloaded the latest from https://nodejs.org/dist/v4.2.1/node-v4.2.1-linux-x64.tar.gz. And it still fails:
rennie@rennie:~/Downloads/node-v4.2.1-linux-x64/bin$ sudo ./npm install -g yo

spawn-sync@1.0.13 postinstall /usr/local/google/home/rennie/Downloads/node-v4.2.1-linux-x64/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync
node postinstall

npm ERR! Linux 3.13.0-63-generic
npm ERR! argv "/usr/local/google/home/rennie/Downloads/node-v4.2.1-linux-x64/bin/node" "/usr/local/google/home/rennie/Downloads/node-v4.2.1-linux-x64/bin/npm" "install" "-g" "yo"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE

npm ERR! spawn-sync@1.0.13 postinstall: node postinstall
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the spawn-sync@1.0.13 postinstall script 'node postinstall'.
npm ERR! This is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node postinstall
npm ERR! You can get their info via:
npm ERR! npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /usr/local/google/home/rennie/Downloads/node-v4.2.1-linux-x64/bin/npm-debug.log
rennie@rennie:/Downloads/node-v4.2.1-linux-x64/bin$ ls
node npm npm-debug.log
rennie@rennie:
/Downloads/node-v4.2.1-linux-x64/bin$

@kenany
Copy link
Contributor

kenany commented Oct 17, 2015

@kenany
Copy link
Contributor

kenany commented Jul 30, 2016

Closing since I do not believe this to be an issue with npm. Can reopen if this is demonstrated to not be the case.

@kenany kenany closed this as completed Jul 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants