【发布时间】:2022-01-25 03:33:30
【问题描述】:
错误:sh:1:nodemon:未找到
包:
{
"name": "shorturlproxy",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "nodemon index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"keywords": [],
"description": "",
"devDependencies": {
"nodemon": "^2.0.15"
}
你知道我做错了什么吗?
【问题讨论】:
-
Heroku 在构建后剥离开发依赖项(阅读the docs)。为什么还要在生产环境中使用 nodemon?
-
我今天没有评论赞成票,但 jonrsharpe 是正确的:首先你不应该在 Heroku 上使用
nodemon。如果您需要构建代码(例如编译 TypeScript 或缩小 CSS 或构建生产 Vue.js 版本或其他东西),请添加一个构建脚本,然后在您的启动脚本中使用node。如果您想使用nodemon进行本地开发,请使用其他名称。开发脚本对此很常见。