Error: npm ERR! write after end

后端 未结 10 1824
悲&欢浪女
悲&欢浪女 2021-01-31 13:54

I am having issues installing Cordova and Ionic. At first I couldn\'t because of what seems to be a corrupted installation, that led me to uni

相关标签:
10条回答
  • 2021-01-31 14:21

    Let, update the latest version of npm for running this command,

    npm install npm@latest -g
    

    Then run this command,

    npm install -g cordova ionic
    
    0 讨论(0)
  • 2021-01-31 14:22

    This still happens randomly on some npm versions. Issue got resolved on downgrading to npm version 5.6.0 using command

    npm install -g npm@5.6.0
    

    Hope that will help someone.

    0 讨论(0)
  • 2021-01-31 14:27

    It happened to me when I tried to install a ionic3 project with npm@5.8, well I solved this issue just add some params, use the following:

    npm i --unsafe-perm
    

    and it works.

    0 讨论(0)
  • 2021-01-31 14:28

    Usually this error is due to your Antivirus blocking access to changing the files, to solve this:

    1- You can try to turn your Antivirus off (temporarily) & try the installation again

    2- If that alone doesn't work, try using the --force option while installing

    I had this issue with some packages & it was solved by using one of the 2 steps above.

    For example:

    npm install -g cordova ionic --force
    
    0 讨论(0)
  • 2021-01-31 14:29

    In my case, I didn't downgrade my npm because it will cause chaos in other dependencies. Instead, I tried running

    npm cache verify
    

    Error gone...

    0 讨论(0)
  • 2021-01-31 14:31

    Try installing latest npm version this happens a lot with ionic.

    npm install -g npm@latest
    npm cache verify
    npm i 
    

    If this doesn't work I advise you to switch to yarn. It's faster & easier to use. This is the link to download YARN. After installing just run this command yarn global add cordova ionic

    Ionic CLI uses npm by default. So go to your project & run $ yarn install.

    If you want Ionic to use yarn by default run this: $ ionic config set -g yarn true

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