【发布时间】:2021-06-11 12:07:19
【问题描述】:
您好,我正在尝试配置 react 并将其与 Flask 框架集成,因此我编辑了 package.json 文件以添加自定义命令以运行 react 前端和 Flask 后端。
这是我在 package.json 文件中编辑的部分:
"scripts": {
"start": "react-scripts start",
"start-app": "cd app && venv/bin/flask run --no-debugger",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
我添加了start-app 。
当我运行 npm start-app 它没有运行时,我收到以下消息:
Usage: npm <command>
where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, fund, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
C:\Users\username\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@6.14.13 C:\Program Files (x86)\nodejs\node_modules\npm
Did you mean this?
start
我无法理解为什么它无法获得 start-app。 注意:我在 windows 10 上使用 VS 代码
【问题讨论】:
标签: node.js python-3.x flask npm