项目中用到一些sass写的样式,但是每次一编译就报错
按照它上面的提醒,npm rebuild node-sass --force,还是一样有错。不过仔细看看他的错误信息我发现了其中这条:
gyp verb could not find "C:UsersmyhAppDataLocalProgramsPythonPython36python.EXE". checking python launcher
gyp verb could not find "C:UsersmyhAppDataLocalProgramsPythonPython36python.EXE". guessing location
gyp verb ensuring that file exists: C:Python27python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:UsersmyhAppDataLocalProgramsPythonPython36python.EXE", you can set the PYTHON env variable.
哈哈,这下知道了,也就是说我本地没有Python环境变量,卧槽,这个node-sass是依赖python写的吗?
带着疑惑,我下载了最新的python安装了,然后按照上面说的配置了一下环境变量:
接着,带着忐忑的心情,敲下:npm install node-sass --save
耶,安装成功!!!
继续编译了一下开发环境,编译成功!!!
可喜可贺啊~~~~