npm install npm -g won't update npm to the latest version

前端 未结 6 1306
刺人心
刺人心 2021-02-19 06:17

I am using npm v5.3.0. Now I want to update npm to v5.4.1.To do this I type the following in my terminal:

npm install -g npm

without any errors.Howe

6条回答
  •  情话喂你
    2021-02-19 06:49

    Please try this for the latest (5.4.1) version:

    npm install -g npm@latest
    

    or for any specific version, for e.g.:

    npm install -g npm@5.4.1
    

    If that doesn't help, go to where you have npm installed and remove the files: npm, npm.cmd.

    After that please try to npm install -g npm@5.4.1 again.

提交回复
热议问题