ubuntu安装配置node-sass

ubuntu安装配置node-sass

背景:新装的ubuntu18系统,运行一个vue项目,中间需要个node-sass依赖,安装过程坎坷,特此记录

一开始用npm install 安装
中间报错,一堆C++编译错误,尝试手动编译,报错如下:

In file included from ./include/v8.h:30:0,
from samples/hello-world.cc:10:
./include/v8-internal.h: In function ‘void v8::internal::PerformCastCheck(T*)’:
./include/v8-internal.h:452:33: error: ‘remove_cv_t’ is not a member of ‘std’
!std::is_same<Data, std::remove_cv_t>::value>::Perform(data);
^
./include/v8-internal.h:452:33: error: ‘remove_cv_t’ is not a member of ‘std’
./include/v8-internal.h:452:50: error: template argument 2 is invalid
!std::is_same<Data, std::remove_cv_t>::value>::Perform(data);
^
./include/v8-internal.h:452:61: error: ‘::Perform’ has not been declared
!std::is_same<Data, std::remove_cv_t>::value>::Perform(data);
不是写C的,而且这看起来也不像给人看的错误,放弃
后面用yarn, cnmp等方式安装,成功!(还没完)

尝试手动安装node-sass,淘宝源安装失败,架梯子装好后运行提示noudle_model/node-sass下没有render文件,搜索得知该文件夹为依赖包编译后生成的,ok,手动make,成功!(还没完)
运行项目,报错
Error: Node Sass version 6.0.1 is incompatible with ^4.0.0.

node12以上版本与sass4不兼容,ok,给node换版本12,换完后yarn run dev成功!

搞完收工

ps:网上有说需要安装mirror-config-china这个东西,反正不符合我的问题,

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值