所以我最近开始使用 zsh 在 python 中编码,我必须为其配置环境变量,现在我试图在 javascript 中启动一个小项目,它不会让我使用 npm。
尝试初始化 repo 会向我抛出这个错误:
npm init -y
zsh: /mnt/c/program files/nodejs//npm: bad interpreter: /bin/sh^M: no such file or directory
当然它不会让我安装软件包。有什么建议么?因为我没有找到任何可以帮助我解决问题的东西。
最佳答案
好的,看起来我必须重新安装 nodejs,因为这是一个新的 shell,zsh 没有安装它:如果有人有类似的问题,你可能想尝试以下方法:
curl -sL https://deb.nodesource.com/setup_15.x | sudo -E bash -
sudo apt-get install -y nodejs
接着
sudo apt-get install -y nodejs
关于javascript - 在 ubuntu windows 10 中使用 NPM 和 zsh shell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65255020/