我正在使用有关如何使用django rest的教程 - react-也有一些测试。当我测试它时,错误出现为:
CypressError: cy.exec('npm run dev') timed out after waiting 60000ms
。
因为此错误发生在"所有"钩子之前,所以我们在当前套件中跳过剩余的测试:'django rest框架/rea ...'
下面是软件包的某些部分。JSON,
{
"name": "django-drf-react-quickstart",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"flush": "pipenv run python ./project/manage.py flush --no-input",
"e2e": "cypress open --project ./project/frontend/",
"dev": "webpack --mode development ./project/frontend/src/index.js --output ./project/frontend/static/frontend/main.js",
"build": "webpack --mode production ./project/frontend/src/index.js --output ./project/frontend/static/frontend/main.js",
"test": "echo "Error: no test specified" && exit 1"
},
我认为问题处于冲洗部分。我使用Virtualenv,并且尝试了许多组合,例如:
运行python ./project/manage.py flush -no-Input
virtualenv运行python ./project/manage.py flush -no-Input
- python ./project/manage.py flush -no-Input
我什至尝试安装pipenv,但没有用。请帮助我。
我在本教程中也有类似的问题,有助于我首先安装pipenv,然后明确说明通往它的路径和python:
"flush": "./project_virtenv/bin/pipenv run ./project_virtenv/bin/python ./project/manage.py flush --no-input",