ModuleNotFoundError: No module named 'yarnlib'
ModuleNotFoundError: No module named 'yarnlib'
我是 React js 的新手,刚拿起一个示例代码并尝试使用“yarn”命令 运行 它,但错误是
Traceback (most recent call last):
File "/usr/bin/yarn", line 32, in
import yarnlib
ModuleNotFoundError: No module named 'yarnlib'
soo 我试过了 运行ning
which yarn
cat /usr/bin/yarn
#! /usr/bin/python
# Copyright 2013 Lars Wirzenius
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# =*= License: GPL-3+ =*=
import cliapp
import collections
import locale
import logging
import os
import re
import shutil
import sys
import tempfile
import time
import ttystatus
import yarnlib
在第 32 行,它有 import yarnlib
不知道怎么安装yarnlib
有人可以帮我解决一下吗?
你下载模块了吗?如果不是,请转到终端 (macOS) 或命令提示符 (Windows),然后输入
pip3 install yarnlib
试试yarn --version
,可能还是没有模块yarnlib,
然后 npm install npm -g
, sudo npm install --global yarn
。
我遇到了同样的问题,然后我更新了npm,重新安装了yarn,成功了。
感谢所有试图帮助我的人..!
这里的答案解决了我的问题
基本上它所做的是删除 nodejs,然后重新安装它并更新 npm...它起作用了
我是 React js 的新手,刚拿起一个示例代码并尝试使用“yarn”命令 运行 它,但错误是
Traceback (most recent call last): File "/usr/bin/yarn", line 32, in import yarnlib ModuleNotFoundError: No module named 'yarnlib'
soo 我试过了 运行ning
which yarn
cat /usr/bin/yarn
#! /usr/bin/python
# Copyright 2013 Lars Wirzenius
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# =*= License: GPL-3+ =*=
import cliapp
import collections
import locale
import logging
import os
import re
import shutil
import sys
import tempfile
import time
import ttystatus
import yarnlib
在第 32 行,它有 import yarnlib
不知道怎么安装yarnlib
有人可以帮我解决一下吗?
你下载模块了吗?如果不是,请转到终端 (macOS) 或命令提示符 (Windows),然后输入
pip3 install yarnlib
试试yarn --version
,可能还是没有模块yarnlib,
然后 npm install npm -g
, sudo npm install --global yarn
。
我遇到了同样的问题,然后我更新了npm,重新安装了yarn,成功了。
感谢所有试图帮助我的人..! 这里的答案解决了我的问题
基本上它所做的是删除 nodejs,然后重新安装它并更新 npm...它起作用了