我正在运行Ubuntu Desktop 18.04 LTS。
/home/ashu# sam --version
A newer version of the AWS SAM CLI is available!
Your version: 0.2.11
Latest version: 0.3.0
See https://github.com/awslabs/aws-sam-local for upgrade instructions
sam version 0.2.11
但是当我尝试按照here指令进行升级时
我没有成功...
该命令:
npm卸载-g aws-sam-local
doesn't un-install the older version
之后-后续命令:
pip install --user --upgrade aws-sam-cli
没有升级它。
root@ashu-XPS-15-9560:~# pip install --user --upgrade aws-sam-cli
Requirement already up-to-date: aws-sam-cli in ./.local/lib/python2.7/site-packages
Requirement already up-to-date: six~=1.11.0 in /usr/lib/python2.7/dist-packages (from aws-sam-cli)
Requirement already up-to-date: cookiecutter~=1.6.0 in ./.local/lib/python2.7/site-packages (from aws-sam-cli)
Requirement already up-to-date: PyYAML~=3.12 in ./.local/lib/python2.7/site-packages (from aws-sam-cli)
Requirement already up-to-date: enum34~=1.1.6 in /usr/lib/python2.7/dist-packages (from aws-sam-cli)
Requirement already up-to-date: aws-sam-translator==1.5.4 in ./.local/lib/python2.7/site-packages (from aws-sam-cli)
Requirement already up-to-date: click~=6.7 in ./.local/lib/python2.7/site-packages (from aws-sam-cli)
Requirement already up-to-date: docker>=3.3.0 in ./.local/lib/python2.7/site-packages (from aws-sam-cli)
Requirement already up-to-date: Flask~=0.12.2 in ./.local/lib/python2.7/site-packages (from aws-sam-cli)
Requirement already up-to-date: boto3~=1.5 in ./.local/lib/python2.7/site-packages (from aws-sam-cli)
Requirement already up-to-date: whichcraft>=0.4.0 in ./.local/lib/python2.7/site-packages (from cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: binaryornot>=0.2.0 in ./.local/lib/python2.7/site-packages (from cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: jinja2>=2.7 in ./.local/lib/python2.7/site-packages (from cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: requests>=2.18.0 in ./.local/lib/python2.7/site-packages (from cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: future>=0.15.2 in ./.local/lib/python2.7/site-packages (from cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: poyo>=0.1.0 in ./.local/lib/python2.7/site-packages (from cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: jinja2-time>=0.1.0 in ./.local/lib/python2.7/site-packages (from cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: jsonschema~=2.6 in ./.local/lib/python2.7/site-packages (from aws-sam-translator==1.5.4->aws-sam-cli)
Requirement already up-to-date: backports.ssl-match-hostname>=3.5; python_version < "3.5" in ./.local/lib/python2.7/site-packages (from docker>=3.3.0->aws-sam-cli)
Requirement already up-to-date: ipaddress>=1.0.16; python_version < "3.3" in ./.local/lib/python2.7/site-packages (from docker>=3.3.0->aws-sam-cli)
Requirement already up-to-date: docker-pycreds>=0.2.3 in ./.local/lib/python2.7/site-packages (from docker>=3.3.0->aws-sam-cli)
Requirement already up-to-date: websocket-client>=0.32.0 in ./.local/lib/python2.7/site-packages (from docker>=3.3.0->aws-sam-cli)
Requirement already up-to-date: itsdangerous>=0.21 in ./.local/lib/python2.7/site-packages (from Flask~=0.12.2->aws-sam-cli)
Requirement already up-to-date: Werkzeug>=0.7 in ./.local/lib/python2.7/site-packages (from Flask~=0.12.2->aws-sam-cli)
Requirement already up-to-date: jmespath<1.0.0,>=0.7.1 in ./.local/lib/python2.7/site-packages (from boto3~=1.5->aws-sam-cli)
Requirement already up-to-date: s3transfer<0.2.0,>=0.1.10 in ./.local/lib/python2.7/site-packages (from boto3~=1.5->aws-sam-cli)
Requirement already up-to-date: botocore<1.11.0,>=1.10.25 in ./.local/lib/python2.7/site-packages (from boto3~=1.5->aws-sam-cli)
Requirement already up-to-date: chardet>=3.0.2 in ./.local/lib/python2.7/site-packages (from binaryornot>=0.2.0->cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: MarkupSafe>=0.23 in ./.local/lib/python2.7/site-packages (from jinja2>=2.7->cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: idna<2.7,>=2.5 in /usr/lib/python2.7/dist-packages (from requests>=2.18.0->cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: urllib3<1.23,>=1.21.1 in ./.local/lib/python2.7/site-packages (from requests>=2.18.0->cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: certifi>=2017.4.17 in ./.local/lib/python2.7/site-packages (from requests>=2.18.0->cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: arrow in ./.local/lib/python2.7/site-packages (from jinja2-time>=0.1.0->cookiecutter~=1.6.0->aws-sam-cli)
Requirement already up-to-date: functools32; python_version == "2.7" in ./.local/lib/python2.7/site-packages (from jsonschema~=2.6->aws-sam-translator==1.5.4->aws-sam-cli)
Requirement already up-to-date: futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" in ./.local/lib/python2.7/site-packages (from s3transfer<0.2.0,>=0.1.10->boto3~=1.5->aws-sam-cli)
Requirement already up-to-date: docutils>=0.10 in ./.local/lib/python2.7/site-packages (from botocore<1.11.0,>=1.10.25->boto3~=1.5->aws-sam-cli)
Requirement already up-to-date: python-dateutil<3.0.0,>=2.1; python_version >= "2.7" in ./.local/lib/python2.7/site-packages (from botocore<1.11.0,>=1.10.25->boto3~=1.5->aws-sam-cli)
Requirement already up-to-date: backports.functools-lru-cache>=1.2.1; python_version == "2.7" in ./.local/lib/python2.7/site-packages (from arrow->jinja2-time>=0.1.0->cookiecutter~=1.6.0->aws-sam-cli)
root@ashu-XPS-15-9560:~# sam --version
A newer version of the AWS SAM CLI is available!
Your version: 0.2.11
Latest version: 0.3.0
See https://github.com/awslabs/aws-sam-local for upgrade instructions
sam version 0.2.11
最佳答案
仔细检查您是否遵循in the SAM documentation的安装说明
但是,看来npm
经常无法删除sam可执行文件。运行which sam
,删除或移动该文件(例如rm sam
),然后重新启动您的Shell。然后,如果遵循安装说明,Linux将在PATH上找到正确的sam
。
(正如您所指出的,问题的根源是一个NPM问题,但是该讨论超出了此问题的范围。)
关于linux - 我有AWS SAM本地0.2.11,但无法将其升级到0.3.0。没有升级,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50475795/