env: python: No such file or directory

这句错误,说明没有找到python的环境变量

但是电脑上安装了python3,python3是可以的

百度一下

解决报错/usr/bin/env: ‘python’: No such file or directory

 但是提示没有权限,这个是因为mac 下面的rootless机制,导致即使在root权限下依然无法修改文件,需要关闭保护机制,比较麻烦。

那就直接在.bash_profile中配置环境变量好了

whereis python3

找到安装路径,我把bin下面的python3拷贝了一份,重命名python,然后配置如下环境变量(这个应该可以配置别名alias之类的)

 export PATH=/usr/local/Cellar/python@3.10/3.10.8/bin:$PATH

 source ~/.bash_profile即可

再次安装node-sass,成功!

更多推荐