npm install error `not foundram Files/nodejs/npm: 3: /mnt/c/Program Files/nodejs/npm:`

后端 未结 12 1748
礼貌的吻别
礼貌的吻别 2021-01-30 08:24

I have installed Ubuntu Bash on Windows. I already have nodejs and npm on my windows machine at C:\\Program Files\\nodejs. In the bash she

12条回答
  •  遥遥无期
    2021-01-30 08:58

    The solution provided by phucanhapril on May 24, 2017 in this thread worked for me.

    To summarise, edit ~/.profile and change your PATH to this:

    PATH="$HOME/bin:$HOME/.local/bin:/usr/bin:$PATH"
    

    (By default it does not include /usr/bin)

    Then run:

    source ~/.profile
    

    I am not quite sure why npm doesn't work properly in the first place, or why /usr/bin isn't in PATH by default, but the solution worked for me.

提交回复
热议问题