使用cnpm安装

npm install cnpm -g --registry=https://registry.npm.taobao.org

cnpm install 

npm uninstall node-sass 

npm i -D sass
1. 单独安装:npm install --unsafe-perm node-sass 
2. 直接使用:npm install --unsafe-perm

以下不管用,window步骤

1、set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/
2、npm install node-sass

如果还报错

node-sass和 node版本不对应 

NodeJSSupported node-sass versionNode Module
Node 17 7.0+ 102
Node 16  6.0+  93
Node 155.0+  , <7.0  88
Node 14 4.14+ 83
Node 13  4.13+, <5.0 79
Node 124.12+, <8.0  72
Node 11  4.10+, <5.0  67
Node 104.9+, <6.0 64
Node 8  4.5.3+, <5.057
Node <8   <5.0   <57

解决方案:

node-sass 版本修改6.0.1

在执行 npm install

解决

 


      
  
   
      
     
      
  
      
      
  

GitHub 加速计划 / no / node-sass
8.5 K
1.33 K
下载
:rainbow: Node.js bindings to libsass
最近提交(Master分支:2 个月前 )
6081731a Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 9 个月前
62c0f46c Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 9 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐