reactjs - 错误:纱线启动 - 错误命令“start”未找到
问题描述
我正在尝试学习 React,并且我正在使用私人回购开始。
我yarn start
在 repo 的目录中运行,但收到错误消息:
yarn run v1.13.0
error Command "start" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我同时安装了节点和纱线。
对于节点:
v10.15.0
node is /usr/local/bin/node
对于纱线:
1.13.0
yarn is /usr/local/bin/yarn
我尝试重新安装节点和纱线,但我收到相同的错误消息。此外,我试图通过删除纱线机会,yarn cache clean
但似乎没有任何效果。
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"
}
}
该目录按以下方式组织:
解决方案
start
该文件的脚本中没有命令package.json
。
"scripts": {
"start": "some command to be run", // you need to add this line
"test": "(eslint lib || true) && jest"
}
也许您想改为运行test
命令 - npm test
/ yarn test
?
推荐阅读
- python - 将大型 JSON 文件转换并拆分为更小的 Parquet 文件
- git - 如何强制 stash pop 覆盖或避免冲突?
- filter - 过滤映射条目中多个键的值并返回包含这些条目的映射 Clojure
- postgresql - 为什么即使对象创建失败,Postgres 序列项也会上升?
- drake - 如何在汽车中创建新的演示?
- python - Tkinter OptionMenu 中的下拉按钮
- c++ - NetBeans 的代码辅助在 Qt 中出现问题
- javascript - 如何使用返回多个项目的 TypeORM 设置 Nestjs 查询?
- node.js - 如何在 Telegram 中捕捉键盘响应
- powershell - PowerShell 以管理员身份运行