NPM install not working at all for anything

triaged

(Akito Kitsune) #1

What I Wanted to Do

npm install

withint a local src directory.

I expected npm to prepare the dependencies for the package I wanted to install on my system.

What Happened Instead

NPM outputs:

npm ERR! asyncWrite is not a function
npm ERR! pna.nextTick is not a function

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-10-22T00_11_16_291Z-debug.log

Reproduction Steps

git clone https://github.com/tellform/tellform.git
cd tellform
npm install

Details

Biggest problem is, that this bug happens on EVERY SINGLE npm install. Every fix I find for this bug is about installing something else or fixing something with NPM itself, while it cannot install anything, at all.

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   'v4l2camera' ]
2 info using npm@6.4.1
3 info using node@v10.12.0
4 verbose npm-session ef17df95441c5b69
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 verbose stack TypeError: asyncWrite is not a function
7 verbose stack     at onwrite (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:48$
7 verbose stack     at WritableState.onwrite (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_$
7 verbose stack     at WriteStream.to [as _worker] (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/ma$
7 verbose stack     at WriteStream._write (/usr/local/lib/node_modules/npm/node_modules/mississippi/node_modules/flush-$7 verbose stack     at doWrite (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:42$7 verbose stack     at writeOrBuffer (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable$7 verbose stack     at WriteStream.Writable.write (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_st$
7 verbose stack     at WriteStream.to [as _worker] (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/ma$7 verbose stack     at WriteStream._write (/usr/local/lib/node_modules/npm/node_modules/mississippi/node_modules/flush-$7 verbose stack     at doWrite (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:42$7 verbose stack     at writeOrBuffer (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable$7 verbose stack     at WriteStream.Writable.write (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_st$7 verbose stack     at WriteStream.to [as _worker] (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/ma$7 verbose stack     at WriteStream._write (/usr/local/lib/node_modules/npm/node_modules/mississippi/node_modules/flush-$7 verbose stack     at doWrite (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:42$7 verbose stack     at writeOrBuffer (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable$7 verbose stack     at WriteStream.Writable.write (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_st$7 verbose stack     at WriteStream.to [as _worker] (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/ma$7 verbose stack     at WriteStream._write (/usr/local/lib/node_modules/npm/node_modules/mississippi/node_modules/flush-$
7 verbose stack     at doWrite (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:42$
7 verbose stack     at writeOrBuffer (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable$
8 verbose cwd /home/pi
9 verbose Linux 4.14.71+
10 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "v4l2camera"
11 verbose node v10.12.0
12 verbose npm  v6.4.1
13 error asyncWrite is not a function
14 verbose exit [ 1, true ]

Platform Info

$ uname -a
Linux hostname 4.14.71+ #1145 Fri Sep 21 15:06:38 BST 2018 armv6l GNU/Linux

$cat /etc/os-release
PRETTY_NAME=“Raspbian GNU/Linux 9 (stretch)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“9”
VERSION=“9 (stretch)”
ID=raspbian
ID_LIKE=debian
HOME_URL=“http://www.raspbian.org/
SUPPORT_URL=“http://www.raspbian.org/RaspbianForums
BUG_REPORT_URL=“http://www.raspbian.org/RaspbianBugs

$ npm --versions
<!-- paste output here -->
{ npm: '6.4.1',
  ares: '1.14.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.12.0',
  openssl: '1.1.0i',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.35',
  zlib: '1.2.11' }
$ node -p process.platform
<!-- paste output here -->
linux

(Lars Willighagen) #2

Do you use the n version manager with a version earlier than 2.1.12? If so, it’s probably related to this:


(Akito Kitsune) #3

How would I install a newer version?


(Lars Willighagen) #4

The other thread suggests that switching back to the previous version of node could make npm work again. They also say node 10.2.1 worked for them, but that may just be because that was their previous version. Then, update n, which should include a fix. If you can’t get npm to work in any way, you can try installing n from source.


(John Gee) #5

Fix and upgrade steps for n installed by npm: