npm install -g firebase-tools 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!
n was updated in v2.1.12 to address this issue. Previously, the new npm was just being copied over the existing folder. This could cause problems when the layout of the node_modules changed as happened in node 10.
Deleting npm and reinstalling will fix the npm issue. Upgrading n
will prevent the issue from happening again when switching versions using n
.
https://github.com/tj/n/issues/508#issuecomment-423933394
e.g.
$ rm /usr/local/bin/node
$ rm -rf /usr/local/lib/node_modules/npm
$ n latest
$ npm install -g n
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
+ n@2.1.12
updated 1 package in 0.466s