npm ERR! asyncWrite is not a function

前端 未结 16 1825
既然无缘
既然无缘 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
    

提交回复
热议问题