我正在运行以下命令来启动 k8s pod
kubectl run api --image=corina1998/api --env="PORT=3000"
我在 api 服务的 pod 日志中收到以下错误。这是 kubectl logs api 命令的输出:
> nodejs-boilerplate@1.0.0 start-docker /usr/src/app
> node src/start.js
internal/fs/utils.js:332
throw err;
^
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (fs.js:617:3)
at tryReadSync (fs.js:382:20)
at Object.readFileSync (fs.js:419:19)
at /usr/src/app/node_modules/docker-secret/dist/index.js:16:18
at Array.forEach (<anonymous>)
at getSecrets (/usr/src/app/node_modules/docker-secret/dist/index.js:12:15)
at Object.<anonymous> (/usr/src/app/node_modules/docker-secret/dist/index.js:30:19)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32) {
errno: -21,
syscall: 'read',
code: 'EISDIR'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nodejs-boilerplate@1.0.0 start-docker: `node src/start.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodejs-boilerplate@1.0.0 start-docker script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
可能是什么问题,我该如何除错?
uj5u.com热心网友回复:
我通过洗掉 package-lock.json 解决了这个奇怪的问题,重新运行 npm install 以生成一个新的 package-lock.json 档案,然后我重建了影像,现在它可以作业了。我以前使用了 yarn install 和 npm install 的组合,并影响了我的 package-lock.json 档案。
0 评论