Javascript 如何在python应用程序中将npm包用作脚本
背景 我想在pythonywhere的Flask应用程序中使用npm包。我已将该软件包安装到我的Pythonywhere环境中,但我无法让应用程序找到该软件包 另外,videojs转录本是videojs的一个插件,我已经在我的Flask应用程序中成功地使用了它。videojs成绩单插件的网站上说这样引用它: 最后,我的站点文件结构如下所示:Javascript 如何在python应用程序中将npm包用作脚本,javascript,npm,web-deployment,pythonanywhere,videojs-transcript,Javascript,Npm,Web Deployment,Pythonanywhere,Videojs Transcript,背景 我想在pythonywhere的Flask应用程序中使用npm包。我已将该软件包安装到我的Pythonywhere环境中,但我无法让应用程序找到该软件包 另外,videojs转录本是videojs的一个插件,我已经在我的Flask应用程序中成功地使用了它。videojs成绩单插件的网站上说这样引用它: 最后,我的站点文件结构如下所示: - WebApp.py - templates - home.html - static - node_modules
- WebApp.py
- templates
- home.html
- static
- node_modules
- without giving the whole structure... the actual videojs-transcript.js file is in node_modules/@packt/videojs-transcript/dist/@packt/videojs-transcript.js
- style.css
- package.json
我尝试过的事情
我已尝试在标记中使用以下方法引用此包:
其他人是如何成功引用和使用Pythonywhere的npm包的?您需要将该文件作为静态文件提供。PythonyWhere帮助页面上有许多文章,指导您完成提供静态文件的过程,并在静态文件无法按预期工作时对其进行调试。