npm ERR! asyncWrite is not a function

前端 未结 16 1827
既然无缘
既然无缘 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 21:57

    This is due to company network security policy

    Work Around

    1. Go to https://codeload.github.com/jashkenas/underscore/zip/master and download the zip file
    2. Create underscore folder on C:\Users{YourUsername}\AppData\Roaming\npm\node_modules\underscore if you want your packge to be global
    3. Extract to folder
    4. Add "dependencies": { "underscore": "^{downloadedVersionNumber}" on you package.json file
    5. create a node_module>underscore and copy the Extract to folder

    0 讨论(0)
  • 2021-02-06 21:58

    that's because, when I'm writing this answer, node 10 is not quite stable. So better stick to node 8. for that you can downgrade to 8.11.3 using

    sudo n 8.11.3
    

    then you can easily install npm modules.

    0 讨论(0)
  • 2021-02-06 21:59

    I've fixed this by:

    1. Cleaning cache npm cache clean -f
    2. Upgrading node to latest version: nvm install <version>
    3. Upgrading npm to latest version: npm i -g npm
    4. Removing dependencies: rm -rf node_modules
    5. Installing dependencies again: npm install
    0 讨论(0)
  • 2021-02-06 22:04

    Solution for windows platform

    1. Uninstall Node
    2. Delete folder from programfiles if exist (C:\Program Files\nodejs)
    3. Delete npm's data folder: C:\Users{Your uername}\AppData\Roaming\npm

    Install node Again(use different installation folder like "C:\Program Files\nodejs-2")

    Root cause is node and nvm installed in same installation folder.

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

    The solution mentioned by DKebler did not work for me either, still got the same error and debug log.

    I had also to downgrade.

    Command Lines

    sudo npm cache clean -f
    
    sudo n 8.11.2
    
    0 讨论(0)
  • 2021-02-06 22:07
    1. Install an old version node, which can run success.
    2. Update your npm (global).
    3. Install the high version node.

    The following is worked in my local environment.

    First install and old version node.

    sudo n 8.11.3

    And then update npm.

    sudo npm i -g npm

    Now, you update your node, everything work fine.

    sudo n 10.12.0

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