无法编译 SCSS

Can't compile SCSS

所以我正在学习 SCSS,我想使用 npm 将我的 SCSS 编译成 CSS,所以我输入

npm run compile: sass

在我的 package.json 中意味着

"scripts": { "compile:sass": "node-sass sass/main.scss css/style.css" },

但是我写命令的时候出现这个错误信息

Error: Cannot find module 'C:\Users\(user)\OneDrive\Desktop\Code\node-sass\bin\node-sass' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

注意:文件名在我的 Package.json 文件中是正确的

有人知道这是怎么回事吗?

如果您需要更多信息,请回复,我可以为您提供文件。

它说您没有安装 node-sass 模块,您是否按照文档 https://www.npmjs.com/package/node-sass 在项目目录中尝试过 npm install install node-sass 。