Javascript Docker npm怪异行为

Javascript Docker npm怪异行为,javascript,typescript,docker,npm,node-modules,Javascript,Typescript,Docker,Npm,Node Modules,我正在使用GitHub的节点模块,它的列表如下 “依赖项”:{ “bx24”:“git+https://github.com/slntopp/bx24.git" } 在package.json中 当我在本地计算机上运行npm install时,node\u modules中的模块结构如下所示: ui/node_modules/bx24 ├── README.md ├── lib │ ├── bx24.d.ts │ ├── bx24.test.d.ts │ ├── entities

我正在使用GitHub的节点模块,它的列表如下

“依赖项”:{
“bx24”:“git+https://github.com/slntopp/bx24.git"
}
package.json中
当我在本地计算机上运行
npm install
时,
node\u modules
中的模块结构如下所示:

ui/node_modules/bx24
├── README.md
├── lib
│   ├── bx24.d.ts
│   ├── bx24.test.d.ts
│   ├── entities
│   │   ├── auth.d.ts
│   │   └── params.d.ts
│   ├── index.d.ts
│   ├── index.js
│   ├── index.js.map
│   ├── message-sender.d.ts
│   ├── message-sender.test.d.ts
│   └── utils
│       ├── parse-window-name.d.ts
│       ├── parse-window-name.test.d.ts
│       ├── unique-key.d.ts
│       └── unique-key.test.d.ts
└── package.json
这是正确的。但当我在Dockerfile中运行相同的程序时,我只得到
package.json
和自述文件:

Step 7/7 : RUN ls -l node_modules/bx24
 ---> Running in 3dcacee291aa
total 8
-rw-r--r--    1 root     root          1691 Oct 26  1985 README.md
-rw-r--r--    1 root     root          2552 Oct 23 01:06 package.json
因此生成失败,未找到依赖项

我试图以不同的方式安装模块,但没有一个成功,所以我假设是关于module
package.json,但找不到问题

在本地和docker计算机上使用相同版本的node(12.18.2)

先谢谢你

链接到Github上的模块

还尝试使用此解决方案更新模块,但没有帮助

我的Dockerfile:

FROM node:lts-alpine as build-stage

ADD ./ui /ui
WORKDIR /ui
RUN apk add git
RUN npm install
RUN npm run build
精确生成错误消息:

Step 6/8 : RUN npm run build
 ---> Running in 750fd2283cbf

> ui@0.1.0 build /ui
> vue-cli-service build


-  Building for production...
Starting type checking service...
Using 1 worker with 2048MB memory limit
 ERROR  Failed to compile with 1 errors3:51:21 PM

This dependency was not found:

* bx24 in ./src/utils/bx24_loader.ts

To install it, you can run: npm install --save bx24
 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ui@0.1.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ui@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-10-26T15_51_22_122Z-debug.log
The command '/bin/sh -c npm run build' returned a non-zero code: 1

您可以附加您的docker文件吗?您好,请附加docker日志为容器显示了什么?尝试
添加ui/ui
您不应该使用
添加
doe到最佳实践指南: