小编Dan*_*ish的帖子

从 Alpine 基础镜像更改为 node-buster 时出现 apk 未找到错误

我已将 docker 中的图像从 Alpine 基本图像更改为 node:14.16-buster,在运行代码时出现“apk not found”错误。

分享代码片段:

FROM node:14.16-buster

# ========= steps for Oracle instant client installation (start) ===============
RUN apk --no-cache add libaio libnsl libc6-compat curl && \
    cd /tmp && \
    curl -o instantclient-basiclite.zip https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip -SL && \
    unzip instantclient-basiclite.zip && \
    mv instantclient*/ /usr/lib/instantclient && \
    rm instantclient-basiclite.zip
Run Code Online (Sandbox Code Playgroud)

您能帮忙吗,我需要改变什么?

node.js docker kubernetes

5
推荐指数
1
解决办法
3518
查看次数

Router.use() 需要一个中间件函数,但在我的节点文件中有一个对象

Node 新手,请解决错误 Router.use() requires a middleware function but got a Object

const bodyParser = require('body-parser');
const express = require('express');
const app = express();

var productRoutes = require('./api/routes/product');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}))

app.use('/products', productRoutes);

module.exports = app;
Run Code Online (Sandbox Code Playgroud)

api/routes/product.js

const express = require('express');
const router = express.Router();
router.get('/', (req, res, next) => { 
  res.status(200).json({message: "Here we are handling the get request for the products"});
});
Run Code Online (Sandbox Code Playgroud)

node.js

0
推荐指数
1
解决办法
8234
查看次数

标签 统计

node.js ×2

docker ×1

kubernetes ×1