Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: [email protected] - Can't shim 'bin\sam.cmd': File doesn't exist. #5653

Closed
3 tasks done
costincaraivan opened this issue Mar 26, 2024 · 7 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@costincaraivan
Copy link

costincaraivan commented Mar 26, 2024

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues/PRs to ensure it has not already been reported or fixed.
  • I have verified that I am using the latest version of Scoop and corresponding bucket.

Package Name

aws-sam-cli

Expected/Current Behaviour

scoop install aws-sam-cli works.

Steps to Reproduce

scoop install aws-sam-cli

> 17687/17688     _tzpath.pyc
17688/17688     _zoneinfo.pyc
Move-Item : Cannot find path 'C:\users\coscara\.config\scoop\apps\aws-sam-cli\1.113.0\SourceDir\Amazon\AWSSAMCLI' because it does not exist.
At line:3 char:1
+ Move-Item "$dir\SourceDir\Amazon\AWSSAMCLI\**" "$dir"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\users\coscar...mazon\AWSSAMCLI:String) [Move-Item], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.MoveItemCommand

Remove-Item : Cannot find path 'C:\users\coscara\.config\scoop\apps\aws-sam-cli\1.113.0\SourceDir' because it does not exist.
At line:4 char:1
+ Remove-Item "$dir\SourceDir", "$dir\$fname" -Force -Recurse
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\users\coscar...113.0\SourceDir:String) [Remove-Item], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

Linking ~\.config\scoop\apps\aws-sam-cli\current => ~\.config\scoop\apps\aws-sam-cli\1.113.0
Creating shim for 'sam'.

Possible Solution

Sorry, I don't have one...

Scoop and Buckets Version

# scoop --version

Current Scoop version:
v0.3.1 - Released at 2022-11-15

'extras' bucket:
60982ba1d (HEAD -> master, origin/master, origin/HEAD) jackett: Update to version 0.21.2163

'main' bucket:
6ad1048f9 (HEAD -> master, origin/master, origin/HEAD) tup: Update to version 0.7.11-148

Scoop Config

scoop config


last_update  : 2024-03-26T13:26:17.3047299+01:00
root_path    : C:\users\coscara\.config\scoop
global_path  : C:\Users\coscara\.config\scoop\global
scoop_branch : master
scoop_repo   : https://github.com/ScoopInstaller/Scoop

PowerShell Version

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.4170
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.4170
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Additional Softwares

No response

@costincaraivan costincaraivan added the bug Something isn't working label Mar 26, 2024
@costincaraivan costincaraivan changed the title [Bug]: Can't shim 'bin\sam.cmd': File doesn't exist. [Bug]: [email protected] - Can't shim 'bin\sam.cmd': File doesn't exist. Mar 26, 2024
@tribals
Copy link

tribals commented Apr 6, 2024

Hello!

I'm interested in SAM CLI too. What can I do for help?

@RiceBen
Copy link

RiceBen commented Apr 15, 2024

Hi @costincaraivan ,
Have you ever tried to update the pre_install script to the following:

"pre_install": [
        "# Workaround for #4980",
        "Start-Process lessmsi -ArgumentList @('x', \"`\"$dir\\$fname`\"\", \"`\"$dir\\`\"\") -Wait -NoNewWindow",
        "Move-Item \"$dir\\SourceDir\\PFiles64\\Amazon\\AWSSAMCLI\\**\" \"$dir\"",
        "Remove-Item \"$dir\\SourceDir\", \"$dir\\$fname\" -Force -Recurse"
    ],

File path: {where scoop installed}\Scoop\buckets\main\bucket\aws-sam-cli.json

My scoop info

❯ scoop --version
Current Scoop version:
v0.3.1 - Released at 2022-11-15

'main' bucket:
a73b88cf3 (HEAD -> master, origin/master, origin/HEAD) gitui: Update to version 0.26.1

@tribals
Copy link

tribals commented Apr 15, 2024

Tried that - didn't work.

>scoop --version
Current Scoop version:
v0.3.1 - Released at 2022-11-15

'extras' bucket:
a322ec5ef (HEAD -> master, origin/master, origin/HEAD) zoom: Update to version 6.0.0.37205

'games' bucket:
6b7ac129a (HEAD -> master, origin/master, origin/HEAD) pcsx2-dev: Update to version 1.7.5706

'main' bucket:
d3194d951 (HEAD -> master, origin/master, origin/HEAD) meilisearch: Add version 1.7.6 (#5639)

'nonportable' bucket:
d849c9ee (HEAD -> master, origin/master, origin/HEAD) 10x-np: Update to version 1.0.146

'versions' bucket:
bd04203b6 (HEAD -> master, origin/master, origin/HEAD) vscode-insiders: Update to version 1.89.0-insider+1713157674040

@omittones
Copy link

@RiceBen This worked for me.

@nemostein-vlgl
Copy link

nemostein-vlgl commented Sep 27, 2024

@RiceBen This worked for me too!
The only difference I found between main/bucket/aws-sam-cli.json and this is the \\PFiles64 folder and that leads me to question why it isn't in the repo already (this very issue is 6 months old already).

Should I make a PR??
Doesn't this affects everyone or is it just a subset of users?

@RiceBen
Copy link

RiceBen commented Sep 30, 2024

@RiceBen This worked for me too! The only difference I found between main/bucket/aws-sam-cli.json and this is the \\PFiles64 folder and that leads me to question why it isn't in the repo already (this very issue is 6 months old already).

Should I make a PR?? Doesn't this affects everyone or is it just a subset of users?

Hi @nemostein-vlgl ,
Sure, please go ahead and make a PR for this issue. I'll appreciate it. 👍

@HUMORCE HUMORCE closed this as completed in b8c971f Nov 8, 2024
@HUMORCE
Copy link
Member

HUMORCE commented Nov 8, 2024

Fixed. d868cef

PS C:\Users\WDAGUtilityAccount> scoop install aws-sam-cli
Scoop uses Git to update itself. Run 'scoop install git' and try again.
Installing 'lessmsi' (2.2.0) [64bit] from 'main' bucket
Loading lessmsi-v2.2.0.zip from cache
Checking hash of lessmsi-v2.2.0.zip ... ok.
Extracting lessmsi-v2.2.0.zip ... done.
Linking ~\scoop\apps\lessmsi\current => ~\scoop\apps\lessmsi\2.2.0
Creating shim for 'lessmsi'.
Creating shortcut for Less MSIérables (lessmsi-gui.exe)
'lessmsi' (2.2.0) was installed successfully!
Installing 'aws-sam-cli' (1.127.0) [64bit] from 'main' bucket
Loading AWS_SAM_CLI_64_PY3.msi from cache
Checking hash of AWS_SAM_CLI_64_PY3.msi ... ok.
Running pre_install script...True
done.
Linking ~\scoop\apps\aws-sam-cli\current => ~\scoop\apps\aws-sam-cli\1.127.0
Creating shim for 'sam'.
Creating shim for 'aws-sam-cli'.
'aws-sam-cli' (1.127.0) was installed successfully!
'aws-sam-cli' suggests installing 'aws'.
PS C:\Users\WDAGUtilityAccount> sam --version
SAM CLI, version 1.127.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants
@omittones @costincaraivan @RiceBen @tribals @HUMORCE @nemostein-vlgl and others