首页 > 解决方案 > 使用 yarn 构建 node.js 应用程序但出现错误 Command "build" not found

问题描述

这是我的 package.json 文件。

{
  "name": "moneymall",
  "version": "1.0.0",
  "description": "A money mall server app.",
  "main": "index.js",
  "author": "Anbu Selvan",
  "license": "ISC",
  "keywords": [],
  "dependencies": {
    "body-parser": "^1.18.3",
    "cors": "^2.8.5",
    "e": "0.0.4",
    "express": "^4.16.4",
    "mysql": "^2.16.0",
    "pug": "^2.0.3",
    "yarn": "^1.15.2"
  },
  "devDependencies": {
    "nodemon": "^1.18.10",
    "react-scripts": "^2.1.8"
  }
}

运行yarn build并得到这个错误。

纱线运行 v1.15.2 错误命令“构建”未找到。info 访问 https://yarnpkg.com/en/docs/cli/run以获取有关此命令的文档

标签: node.js

解决方案


如果执行yarn run,它将显示可以运行的命令列表。

理想情况下yarn run dev会完成编译构建的技巧


推荐阅读