sass 问题报错

一  npm install 之后里边包含sass样式框架

.gyp ERR! stack Error: Command failed: E:\pycharm\pythonn\python.EXE -c import sys; print "%s.%s.%s" % 

​
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.    

npm ERR! A complete log of this run can be found in:
npm ERR!     E:\nodejs\node_global\_logs\2022-03-09T14_28_13_557Z-debug.log

gyp ERR! stack Error: Command failed: E:\pycharm\pythonn\python.EXE -c import sys; print "%s.%s.%s" % 
sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:397:12)
gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "E:\\nodejs\\node.exe" "D:\\abiiii\\webzp\\node_modules\\node-gyp\\bin\\node-gyp.js" 
"rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="  
gyp ERR! cwd D:\abiiii\webzp\node_modules\node-sass
gyp ERR! node -v v16.13.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

​npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.    

npm ERR! A complete log of this run can be found in:
npm ERR!     E:\nodejs\node_global\_logs\2022-03-09T14_28_13_557Z-debug.log

意思是让你安装pyhton 2顺手配置环境,大哥我就是个前端就为了运行sass样式啊,当然是选择不装单独搞

npm install sass-loader node-sass vue-style-loader --D

可能还是会报错,此时配置一个淘宝镜像单独安装

npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass

继续执行刚那个命令

npm install sass-loader node-sass vue-style-loader --D

此时你会发现下载的sass非常的高级,如果下载的是别人的代码,那么很不幸版本可能不同依旧运行不了。报这个错

记-安装SASS无法运行项目,报错TypeError: this.getOptions is not a function

下边的错误是让你换版本,但是不是她标记的7不要直接安装7没得用

​
Module build failed: Error: Node Sass version 7.0.1 is incompatible with ^4.0.0.

​

执行这个指令此时已经在包里有声明,卸载重新安装

npm uninstall node-sass
npm i -D sass

成功之后

darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ sass@1.49.9
removed 7 packages and updated 1 package in 7.492s

44 packages are looking for funding
  run `npm fund` for details

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值