本文介绍了错误:纱线开始 - 错误命令“开始"未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习 React,并且我正在使用一个私有存储库来开始它.

I am trying to learn React and I am using a private repo to start with it.

我在 repo 的目录中运行 yarn start 但我收到错误消息:

I run yarn start in the directory of the repo but I get the error message:

yarn run v1.13.0
error Command "start" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

我已经安装了 node 和 yarn.

I have both node and yarn installed.

对于节点:

v10.15.0
node is /usr/local/bin/node

对于纱线:

1.13.0
yarn is /usr/local/bin/yarn

我尝试重新安装节点和纱线,但收到相同的错误消息.此外,我尝试通过 yarn cache clean 删除纱线机会,但似乎没有任何效果.

I tried to reinstall both node and yarn but I get the same error message. moreover I tried to remove the yarn chance via yarn cache clean but nothing seems to work.

package.json 包含以下内容:

{
  "name": "02-Manipulating-Strings",
  "version": "1.0.0",
  "author": "ssaunier",
  "license": "UNLICENSED",
  "private": true,
  "devDependencies": {
    "eslint": "^4.7.2",
    "eslint-config-airbnb-base": "^12.0.0",
    "eslint-plugin-import": "^2.7.0",
    "jest": "^21.1.0"
  },
  "scripts": {
    "test": "(eslint lib || true) && jest"
  }
}

目录的组织方式如下:

推荐答案

package.json 文件的脚本中没有 start 命令.

There is no start command inside the scripts of the package.json file.

"scripts": {
  "start": "some command to be run", // you need to add this line
  "test": "(eslint lib || true) && jest"
}

也许您想改为运行 test 命令 - npm test/yarn test?

Maybe you want to run the test command instead - npm test / yarn test?

这篇关于错误:纱线开始 - 错误命令“开始"未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 10:22