项目中用到一些sass写的样式,但是每次一编译就报错

安装node-saas包报错问题

按照它上面的提醒,npm rebuild node-sass --force,还是一样有错。不过仔细看看他的错误信息我发现了其中这条:

gyp verb could not find "C:\Users\myh\AppData\Local\Programs\Python\Python36\python.EXE". checking python launcher
gyp verb could not find "C:\Users\myh\AppData\Local\Programs\Python\Python36\python.EXE". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\myh\AppData\Local\Programs\Python\Python36\python.EXE", you can set the PYTHON env variable.

哈哈,这下知道了,也就是说我本地没有Python环境变量,卧槽,这个node-sass是依赖python写的吗?

带着疑惑,我下载了最新的python安装了,然后按照上面说的配置了一下环境变量:

安装node-saas包报错问题

 

接着,带着忐忑的心情,敲下:npm install node-sass --save 

耶,安装成功!!!

继续编译了一下开发环境,编译成功!!!

可喜可贺啊~~~~

相关文章:

  • 2022-02-13
  • 2022-12-23
  • 2021-12-14
  • 2021-07-06
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-20
  • 2021-06-21
  • 2021-11-21
  • 2021-06-15
  • 2021-11-03
相关资源
相似解决方案