npm报错 TypeError [ERR_INVALID_ARG_TYPE]: The “path“ argument must be of type string.Received undefine

npm报错 TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string.Received undefined

解决办法:

1.修改static文件夹下的package.json里sass-loader版本

"sass-loader": "^7.3.1"

2.重新npm install

3.npmrun dev

4.遇到了新的错误

Node Sass version 5.0.0 is incompatible with^4.0.0

此错误来自sass-loader。因为node-sass @latest为v5.0.0,而sass-loader期望值为^ 4.0.0。
5.卸载5.0 重装4.x

# 卸载node-sass
npm uninstall node-sass
# 安装4.x版本(5.0之前)
npm install node-sass@4.14.1

6.npmrun dev

7.成功解决问题

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值