无法在开发人员模式下启动Django-Tailwind [英] Can't Start Django-Tailwind in Dev Mode

查看:68
本文介绍了无法在开发人员模式下启动Django-Tailwind的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows上使用django-tailwind,并正在按照安装步骤进行操作.当前步骤是使用 python manage.py tailwind start 以开发人员模式启动顺风".这总是失败,并且以下文本块是生成的日志文件:

I am working with django-tailwind on Windows and am following the steps to install. The current step is to 'start tailwind in dev mode' using python manage.py tailwind start. This always fails and the following block of text is the resulting log file:

...
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle django_tailwind@~prestart: django_tailwind@
6 info lifecycle django_tailwind@~start: django_tailwind@
7 verbose lifecycle django_tailwind@~start: unsafe-perm in lifecycle true
8 verbose lifecycle django_tailwind@~start: PATH: C:\Users\jpyth\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;c:\Users\jpyth\Django\hhs-robotics-website\theme\static_src\node_modules\.bin;C:\Users\jpyth\Django\hhs-robotics-website\venv\Scripts;C:\ActiveTcl\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\jpyth\AppData\Local\Microsoft\WindowsApps;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\jpyth\AppData\Local\Programs\Python\Python37\;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\GnuWin32\bin;C:\Program Files (x86)\Gpg4win\..\GnuPG\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\GCL-2.6.1\bin\;C:\ccl\launcher;C:\Program Files (x86)\ffmpeg\bin;C:\opencv\sources\3rdparty\ffmpeg\;C:\Users\jpyth\AppData\Local\Programs\Python\Python37\Scripts\;C:\ActiveTcl\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\jpyth\AppData\Local\Microsoft\WindowsApps;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\jpyth\AppData\Local\Programs\Python\Python37\;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\GnuWin32\bin;C:\Program Files (x86)\Gpg4win\..\GnuPG\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\GCL-2.6.1\bin\;C:\ccl\launcher;C:;C:\Users\jpyth\AppData\Local\Programs\Microsoft VS Code\bin
9 verbose lifecycle django_tailwind@~start: CWD: c:\Users\jpyth\Django\hhs-robotics-website\theme\static_src
10 silly lifecycle django_tailwind@~start: Args: [ '/d /s /c', "watch 'npm run build-postcss' ./src" ]
11 silly lifecycle django_tailwind@~start: Returned: code: 1  signal: null
12 info lifecycle django_tailwind@~start: Failed to exec start script
13 verbose stack Error: django_tailwind@ start: `watch 'npm run build-postcss' ./src`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\jpyth\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:210:5)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\jpyth\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:210:5)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid django_tailwind@
15 verbose cwd c:\Users\jpyth\Django\hhs-robotics-website\theme\static_src
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\jpyth\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
18 verbose node v12.13.0
19 verbose npm  v6.7.0
20 error code ELIFECYCLE
21 error errno 1
22 error django_tailwind@ start: `watch 'npm run build-postcss' ./src`
22 error Exit status 1
23 error Failed at the django_tailwind@ start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

我注意到的一件事是它失败的命令使用的是 watch ,它不是Windows命令.但是,我确实尝试将输入运行到 watch ( npm运行build-postcss ),但无济于事.我什至创建了一个自定义的 watch.bat 脚本,该脚本已添加到PATH,但仍然失败.我不知道从这里去哪里.如何在我的Django应用程序中使用顺风工作的CSS?

One thing I noticed is that the command that it is failing on uses watch, which is not a Windows command. However, I did try running the input to watch (npm run build-postcss) but to no avail. I even created a custom watch.bat script which I added to PATH and it still fails. I have no clue where to go from here. How can I get tailwind css to work in my Django app?

推荐答案

抱歉,昨天才遇到同样的事情,遇到了您的问题,但这是解决方法,因为我们使用的是Windows,因此我们必须进行更改我们使用的qoutes在./theme/static_src/package.json中更改开始":观看'npm run build-postcss'./src"

Sorry this came late faced the same thing just yesterday and came across your question but here's the fix since we are using windows we have to change the qoutes we use so within ./theme/static_src/package.json change "start": "watch 'npm run build-postcss' ./src"

"start": "watch \"npm run build-postcss\" ./src"

这篇关于无法在开发人员模式下启动Django-Tailwind的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆