javascript - scratch-blocks@0.1.0 预发布:`python build.py && webpack`
问题描述
我在 linux 终端运行暂存块
https://scratch.mit.edu/discuss/topic/289503/
我遇到的问题是
python build.py && webpack
scratch-blocks@0.1.0 预发布:python build.py && webpack
你能帮帮我吗?
npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.
> scratch-blocks@0.1.0 prepublish /mnt/e/hit and try/scratch/scratch-blocks
> python build.py && webpack
Traceback (most recent call last):
File "build.py", line 39, in <module>
raise Exception("Blockly build only compatible with Python 2.x.\n"
Exception: Blockly build only compatible with Python 2.x.
You are using: 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0]
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scratch-blocks@0.1.0 prepublish: `python build.py && webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scratch-blocks@0.1.0 prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/soumitya/.npm/_logs/2020-11-05T05_06_36_269Z-debug.log
解决方案
当我将 python2 设置为默认值时,它可以工作:
通过添加以下内容为 Linux 终端中的默认 python 设置优先级:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
在这里,我们将python3
优先级设置为 10 和python2
优先级 1。这将成为python3
默认的 python。如果您希望 Python2 作为默认值,则将 python2 的优先级设置为高于 python3
推荐阅读
- python - 为什么有些 Jupyter Notebook 输出单元格呈现输出提示(即 Out[4]:) 而有些则没有?
- javascript - JSHint:For循环中的“意外'var'”
- python - 有没有办法等待条件为真?
- css - 图像布局(可变宽度,每行等高)
- sql - 数据库与模型中的 Ruby 外键约束
- python-3.x - 在 DataFrame 的多列上评估相同的逻辑条件
- ruby-on-rails - 如何访问lib目录rails 6中的params hash
- scala - Akka Actor 的实例变量是线程安全的吗?
- ruby - 浏览器自动下载到默认位置
- sql - SQL根据条件获取唯一值