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

后端 未结 12 1786
礼貌的吻别
礼貌的吻别 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 09:04

    I received this error when I modified my "~/.bashrc" file to shorten up the bash directory.

    At first I had:

    if [ "$color_prompt" = yes ]; then
                PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
        else
                    PS1='${debian_chroot:+($debian_chroot)}\u\h:\W\$'
            fi
    

    ....But then could not run any node operation. I rolled it back and the error stopped happening.

    After some troubleshooting, I was able to fix the error by adding ~ before the $ on PS1='${debian_chroot:+($debian_chroot)}\u\h:\W\~$

提交回复
热议问题