我有一个简单的 Node.js 应用程序,它通过运行调用 npn start
的 nodemon app.js
在本地运行良好
我正在通过将 Amplify 连接到我的 Github 存储库来将此应用程序部署到 AWS Amplify,但构建被卡住,构建日志中的最后一条消息是 # 执行命令:npm ci
这是 package.json:
{
"name": "nodejs2",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon app.js",
"build": "node app.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"ejs": "^3.1.6",
"express": "^4.17.1"
},
"devDependencies": {
"nodemon": "^2.0.7"
}
}
这是 Amplify 构建脚本:
version: 1
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build
artifacts:
# IMPORTANT - Please verify your build output directory
baseDirectory: /
files:
- '**/*'
cache:
paths:
- node_modules/**/*
有人知道这里出了什么问题吗?