本文介绍: 修改镜像地址: —sass_binary_site=https://npm.taobao.org/mirrors/nodesass/参照更多: https://juejin.cn/post/7029193821955031054。

Failed to resolve loader: sassloader

 ERROR  Failed to compile with 1 error                                                                                                                                           10:49:21

Failed to resolve loader: sass-loader
You may need to install it.

npm ERR! code E404

$ npm install nodes-sass --save-dev --legacy-peer-deps
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/nodes-sass - Not found
npm ERR! 404
npm ERR! 404  'nodes-sass@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! A complete log of this run can be found in:

修改镜像地址: —sass_binary_site=https://npm.taobao.org/mirrors/nodesass/

$ npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ --legacy-peer-deps
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN deprecated eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.

added 338 packages, and changed 95 packages in 2m

118 packages are looking for funding
  run `npm fund` for details
$ npm i sass-loader --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ --legacy-peer-deps
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

added 1 package in 2m

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

最终安装完成

$ node -v
v16.16.0

package.json

"dependencies": {
	#...略其它...
    "node-sass": "^9.0.0",
    "sass-loader": "^13.3.2",
 }

参照更多: https://juejin.cn/post/7029193821955031054

原文地址:https://blog.csdn.net/zoeou/article/details/134640838

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。

如若转载,请注明出处:http://www.7code.cn/show_1759.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注