在我的反应商务项目中,api 容器有效。
我已经尝试删除 node_modules 和 package-lock.json,从 pc 重新安装 nodejs,但没有任何效果:C
这就是问题:
Installing dependencies...
Running 'bash -c npm run inspect:goodcastle' as user node in Docker container...
2021-09-02T21:59:01.121178590Z
> reaction-api@3.10.34 inspect:goodcastle
> npm run check-node-version && NODE_ENV=development NODE_OPTIONS='--experimental-modules --experimental-json-modules' nodemon --inspect=0.0.0.0:9229 ./src/index.js
2021-09-02T21:59:01.121279002Z
2021-09-02T21:59:02.632389299Z
> reaction-api@3.10.34 check-node-version
> node ./src/checkNodeVersion.cjs
2021-09-02T21:59:02.632439993Z
internal/modules/cjs/loader.js:883
throw err;
^
2021-09-02T21:59:02.700526859Z
Error: Cannot find module 'semver'
Require stack:
- /usr/local/src/app/src/checkNodeVersion.cjs
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/usr/local/src/app/src/checkNodeVersion.cjs:7:16)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/usr/local/src/app/src/checkNodeVersion.cjs' ]
}