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.成功解决问题

你可能感兴趣的:(解决方法,前端,npm)