The preinstall npm script of coa package throws "Cannot find module '/Users/dulin/workspace/xxx/xxx-m/node_modules/coa/compile.js'" error

Viewed 1035

When I try to execute npm audit fix command, got error:

> coa@2.1.3 preinstall /Users/dulin/workspace/xxx/xxx-m/node_modules/coa
> start /B node compile.js & node compile.js

sh: start: command not found
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module '/Users/dulin/workspace/xxx/xxx-m/node_modules/coa/compile.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

I had read this question: Cannot find module coa/compile.js. But none of the answers work for me.

My project doesn't use coa package as dependency directly, I found it used by svgo package and svgo package used by postcss-svgo package in package-lock.json.

How can I solve this?

1 Answers
Related