当我尝试运行此命令 “npm run compile:sass” 时,显示了以下错误:

huangapple go评论83阅读模式
英文:

when i try to run this cmd "npm run compile:sass" is show me this error

问题

'CSS' 未被识别为内部或外部命令,可执行程序或批处理文件。
node:internal/modules/cjs/loader:1078
throw err;
^

错误:找不到模块 'D:\Takbeer\Courses\node-sass\bin\node-sass'
at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
at Module._load (node:internal/modules/cjs/loader:920:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js 版本 v18.16.0
当我尝试运行此命令 “npm run compile:sass” 时,显示了以下错误:

英文:

Code Git Repo:
https://github.com/TakbeerAli/CssError

'CSS' is not recognized as an internal or external command,
operable program or batch file.
node:internal/modules/cjs/loader:1078
throw err;
^

Error: Cannot find module 'D:\Takbeer\Courses\node-sass\bin\node-sass'
at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
at Module._load (node:internal/modules/cjs/loader:920:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v18.16.0
当我尝试运行此命令 “npm run compile:sass” 时,显示了以下错误:

答案1

得分: 0

也许你只需要安装你没有的模块?
使用 "npm install package-name" 或者如果你的目录中有 package-lock.json 文件,只需使用 "npm ci" 命令。

如果我错了,请有人纠正我 当我尝试运行此命令 “npm run compile:sass” 时,显示了以下错误:

英文:

Maybe you just need to install module that you don't have?
Use "npm install package-name" or if you have package-lock.json file in you directory just use "npm ci" command.

If I'm wrong please someone correct me 当我尝试运行此命令 “npm run compile:sass” 时,显示了以下错误:

答案2

得分: 0

没有错误在代码中。当我将项目文件夹从子文件夹移动到其父文件夹(如磁盘:C或E)时,这解决了我的问题并开始正常工作。

英文:

There is no error in the code. When I move my project folder from the child folder to its parent folder Like ( Disk: C or E ), this solves my problem and starts working

huangapple
  • 本文由 发表于 2023年6月1日 03:32:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76376736.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定