npm ERR! asyncWrite is not a function

前端 未结 16 1770
既然无缘
既然无缘 2021-02-06 21:44

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!

相关标签:
16条回答
  • 2021-02-06 22:08

    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
    
    0 讨论(0)
  • 2021-02-06 22:09

    I am guessing it is an incompatibility between npm v5 and node v10. To solve this I downgraded node to v9, upgraded npm to v6, then upgraded node to v10:

    n 9.10.1
    npm i -g npm
    n stable
    
    0 讨论(0)
  • 2021-02-06 22:09

    Use sudo when switching node version with n example sudo n 10.4.1

    0 讨论(0)
  • 2021-02-06 22:10

    I was able to fix the issue by forcing readable-stream@2.3.0.

    0 讨论(0)
提交回复
热议问题