Cannot find module coa/compile.js

I'm running yarn in a project, but I'm getting this error:

Exit code: 1
Command: start /B node compile.js & node compile.js
Arguments: 
Directory: 项目名/node_modules/coa
Output:
/bin/sh: 1: start: not found
internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module '项目名/node_modules/coa/compile.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {

I've already uninstalled all the .lock and node_module folder, but it still doesn't work.

解决:Last release contains malicious code · Issue #99 · veged/coa · GitHub

Short-term fix

No fix should be needed as the affected versions have been removed. But I'm leaving what I wrote initially just in case something does go wrong again. For now I'd advise you to pin the version as described below until this has been resolved conclusively.

🤕 Use "coa@2.0.2" specifically. 2.0.3. is the first update that broke things. 🤕

Additionally as @herrwitzi suggests in the comments if you use yarn you can add a resolution to your package.json

"resolutions": { "coa": "2.0.2" },

And as @bugron suggested for other package managers add those to your package.json:
pnpmpackage.json | pnpm

"pnpm": {
    "overrides": {
      "coa": "2.0.2"
    }
},

yarnSelective dependency resolutions | Yarn

"resolutions": {
    "coa": "2.0.2"
}

在package.json文件中加入上面的resolutions配置

为什么是2.0.2?

热门NPM库 “coa” 和“rc” 接连遭劫持,影响全球的 React 管道

npm 库 “coa” 竟然发布了新版本???要知道这个项目已经有数年没有人动过,今天突然出现在npm库中。“coa” 是 Node.js 项目的命令行选项解析器。该项目的最新稳定版 2.0.2 在2018年12月发布。但就在几个小时前,npm 上出现了可疑版本 2.0.3、2.0.4、2.1.1、2.1.3和3.1.3,导致依赖于 “coa” 库的 React 程序包崩溃。

90fb7d4d34be3f8165699bf0c9d6be4f.png

问题:node.js - Cannot find module coa/compile.js - Stack Overflow

回答: 根据你提供的引用内容,你在运行yarn时遇到了一个错误。错误信息显示找不到模块'项目名/node_modules/coa/compile.js'。\[1\]为了解决这个问题,你可以按照以下步骤进行操作:首先,进入项目目录并创建一个名为build的文件夹。然后,进入build文件夹并运行以下命令:cmake .. -DCMAKE_CXX_COMPILER=`which clang++` -DCMAKE_C_COMPILER=`which clang` -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON。\[2\]如果你仍然无法解决问题,你可以尝试在CMakeLists.txt文件中添加以下代码来确保最终的可执行文件具有导出的符号:set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic") find_program (OBJCOPY_PATH NAMES "llvm-objcopy" "llvm-objcopy-10" "llvm-objcopy-9" "llvm-objcopy-8" "objcopy" PATHS "/usr/local/Cellar/binutils/2.36.1/bin/")。\[3\]希望这些步骤能帮助你解决问题。 #### 引用[.reference_title] - *1* [Cannot find module coa/compile.js](https://blog.csdn.net/CamilleZJ/article/details/121382449)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [Mac 安装 ClickHouse 报错: Mac 10.15.4: Cannot find objcopy](https://blog.csdn.net/universsky2015/article/details/118021660)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值