liyinchigithub / Charles2Postman

将Charles抓包文件,转为支持导入postman文件格式
Apache License 2.0
83 stars 22 forks source link

转换时报错,错误信息见详情 #12

Closed zhangxihao closed 2 years ago

zhangxihao commented 2 years ago

我的时Mac设备(macOS big sur),转换时给出如下错误,请问如何解决

$ sudo sh run.sh 
Password:
run.sh: line 1: @echo: command not found
开始转换
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'log4js'
Require stack:
- /Users/xihaozhang/workspace/Git/github/Charles2Postman/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/xihaozhang/workspace/Git/github/Charles2Postman/index.js:1:6785)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/xihaozhang/workspace/Git/github/Charles2Postman/index.js' ]
}
输出文件outputFile
liyinchigithub commented 2 years ago

@zhangxihao

npm install log4js
npm install
liyinchigithub commented 2 years ago

确认下您的电脑是否已安装nodejs环境

node -v

image

下载安装nnodejs