reactjs - 错误: yarn start - error Command "start" not found

标签 reactjs npm yarnpkg

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

我在存储库目录中运行yarn start,但收到错误消息:

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

我安装了节点和 yarn 。

对于节点:

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

对于 yarn :

1.13.0
yarn is /usr/local/bin/yarn

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

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"
  }
}

目录按以下方式组织:

project directory

最佳答案

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

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

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

关于reactjs - 错误: yarn start - error Command "start" not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54393192/

相关文章:

javascript - 有没有办法在 react-native 中缩放 View ?

javascript - Meteor 尚不支持 ECMA7 静态原型(prototype),有什么好的解决方法吗?

node.js - Electron Windows Store events.js 抛出未处理的 'error' 事件

javascript - 如何优化多个文件的输出 typescript 中的模块 namespace ,使用 gulp

windows - yarn global add 在 Windows 上损坏了吗?

javascript - 使用 webpack 转译 ES6 模块后,模块未导出

npm - 为什么 NPM 模块的依赖总是可以安装到嵌套的 node_modules 中?

yarnpkg - 为什么以及何时 yarn 决定不在工作区中提升包裹?

javascript - 在 Windows 上安装 Yarn 时挂起的 Fibers/node-gyp

javascript - 如何用数字替换字符串中出现的字母