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

前端 未结 6 1293
刺人心
刺人心 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:32

    The problem was that I has set the PATH variable in my ~/.profile wrong. To help you understand.I had changed npm prefix to ~/.npm-global

    However I set path to ~/npm-global.So I fixed the PATH variable in my ~/.profile to point to ~/.npm-global instead.

提交回复
热议问题