【ERROR in Cannot find module 'node-sass'】【this.getResolve is not a function】

简介: 在安装sass插件时报错

$ npm ls
//返回的报错信息
npm ERR! peer dep missing: webpack@^4.36.0, required by sass-loader@8.0.0
npm ERR! peer dep missing: vue-template-compiler@^2.0.0, required by vue-loader@13.7.3


$ npm install sass-loader node-sass --save-dev
//返回的报错信息
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Users\jinwe\truth_hold\node_modules\node-sass\node_modules
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Users\jinwe\truth_hold\node_modules\node-sass\node_modules'
npm ERR!  [OperationalError: EPERM: operation not permitted, mkdir 'C:\Users\jinwe\truth_hold\node_modules\node-sass\node_modules'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, mkdir 'C:\Users\jinwe\truth_hold\node_modules\node-sass\node_modules'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'mkdir',
npm ERR!     path: 'C:\\Users\\jinwe\\truth_hold\\node_modules\\node-sass\\node_modules'
npm ERR!   },
npm ERR!   stack: "Error: EPERM: operation not permitted, mkdir 'C:\\Users\\jinwe\\truth_hold\\node_modules\\node-sass\\node_modules'",
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'C:\\Users\\jinwe\\truth_hold\\node_modules\\node-sass\\node_modules',
npm ERR!   parent: 'truth_hold'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jinwe\AppData\Roaming\npm-cache\_logs\2019-11-05T01_54_51_276Z-debug.log
C:\Users\jinwe\truth_hold>npm run dev
> truth_hold@1.0.0 dev C:\Users\jinwe\truth_hold
> node build/dev-server.js wx
 ERROR  Failed to compile with 2 errors


这时运行npm ls,会出现这个下面的错误


$ npm ls



并且启动项目的时候报错


$ npm run dev
//返回的错误信息,已简化
ERROR in Cannot find module 'node-sass'
this.getResolve is not a function


这是因为当前sass的版本太高,webpack编译时出现了错误,这个时候只需要换成低版本的就行


修改package.json文件,将里面的 "sass-loader"的版本换成更低的版本,比如我现在是"sass-loader": "^8.0.0"换成了"sass-loader": "^7.3.1"


重新安装sass,再启动项目就成功了


//重新安装sass
$ npm install sass-loader node-sass --save-dev
//启动项目
$ npm run dev



目录
相关文章
|
8月前
|
API C++
【Azure 环境】VS Code登录China Azure(Function)报错 An error occurred while signing in: invalid_request - AADSTS65002
An error occurred while signing in: invalid_request - AADSTS65002: Consent between first party application 'c27c220f-ce2f-4904-927d-333864217eeb' and first party resource '797f4846-ba00-4fd7-ba43-dac1f8f63013' must be configured via preauthorization - applications owned and operated by Microsoft mus
399 13
Node——activeError: error:0308010C:digital envelope routines::unsupported
启动项目报错error:0308010C:digital envelope routines::unsupported,其实很简单因为node版本的原因,本地默认的版本是v20.15.0,项目是老项目默认的版本是v16.16.0;
356 2
|
JavaScript
node环境之Error: Cannot find module ‘chalk’ 报错无法解决的问题—-网上说让你npm install chalk 基本是没有用的-优雅草央千澈解决方案
node环境之Error: Cannot find module ‘chalk’ 报错无法解决的问题—-网上说让你npm install chalk 基本是没有用的-优雅草央千澈解决方案
1110 13
node环境之Error: Cannot find module ‘chalk’ 报错无法解决的问题—-网上说让你npm install chalk 基本是没有用的-优雅草央千澈解决方案
|
Java Windows
【Azure Function】部署Java Function失败:报错deploy [ERROR] Status code 401和警告 'China North 3' may not be a valid region
1:deploy [ERROR] Status code 401, (empty body). 2: China North 3 may not be a valid region,please refer to https://aka.ms/maven_function_configuration#supported-regions for values. 3:  <azure.functions.maven.plugin.version>1.36.0</azure.functions.maven.plugin.version>
362 11
|
Linux Python
【Azure Function】Python Function部署到Azure后报错No module named '_cffi_backend'
ERROR: Error: No module named '_cffi_backend', Cannot find module. Please check the requirements.txt file for the missing module.
393 2
|
C++ Python
【Azure 应用服务】Azure Function Python函数部署到Azure后遇见 Value cannot be null. (Parameter 'receiverConnectionString') 错误
【Azure 应用服务】Azure Function Python函数部署到Azure后遇见 Value cannot be null. (Parameter 'receiverConnectionString') 错误
243 0
|
Python
【Azure 应用服务】Azure Function HTTP Trigger 遇见奇妙的500 Internal Server Error: Failed to forward request to http://169.254.130.x
【Azure 应用服务】Azure Function HTTP Trigger 遇见奇妙的500 Internal Server Error: Failed to forward request to http://169.254.130.x
284 0
|
人工智能 Python
083_类_对象_成员方法_method_函数_function_isinstance
本内容主要讲解Python中的数据类型与面向对象基础。回顾了变量类型(如字符串`str`和整型`int`)及其相互转换,探讨了加法在不同类型中的表现。通过超市商品分类比喻,引出“类型”概念,并深入解析类(class)与对象(object)的关系,例如具体橘子是橘子类的实例。还介绍了`isinstance`函数判断类型、`type`与`help`探索类型属性,以及`str`和`int`的不同方法。最终总结类是抽象类型,对象是其实例,不同类型的对象有独特运算和方法,为后续学习埋下伏笔。
234 7
083_类_对象_成员方法_method_函数_function_isinstance

热门文章

最新文章