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

Can't upgrade to Chocolatey 0.9.9.3 - The term 'false' is not recognized as the name of a cmdlet #215

Closed
Taomyn opened this issue Mar 30, 2015 · 10 comments

Comments

@Taomyn
Copy link

Taomyn commented Mar 30, 2015

Some versions of PowerShell have stricter requirements around booleans. So in more modern versions of PowerShell, choco is completely broken due to this error.

Went to upgrade from 0.9.9.2 and got this:

 Chocolatey v0.9.9.3
 Chocolatey is unpacking required files for use. Overwriting? True
 false : The term 'false' is not recognized as the name of a cmdlet, function, s
cript file, or operable program. Check t
 he spelling of the name, or if a path was included, verify that the path is cor
rect and try again.
 At C:\ProgramData\chocolatey\lib\chocolatey\tools\chocolateyInstall\helpers\cho
colateyInstaller.psm1:24 char:17
 + $overrideArgs = false
 +                 ~~~~~
     + CategoryInfo          : ObjectNotFound: (false:String) [], CommandNotFoun
dException
     + FullyQualifiedErrorId : CommandNotFoundException
 false : The term 'false' is not recognized as the name of a cmdlet, function, s
cript file, or operable program. Check t
 he spelling of the name, or if a path was included, verify that the path is cor
rect and try again.
 At C:\ProgramData\chocolatey\lib\chocolatey\tools\chocolateyInstall\helpers\cho
colateyInstaller.psm1:27 char:13
 + $forceX86 = false
 +             ~~~~~
     + CategoryInfo          : ObjectNotFound: (false:String) [], CommandNotFoun
dException
     + FullyQualifiedErrorId : CommandNotFoundException
 WARNING: The names of some imported commands from the module 'chocolateyInstall
er' include unapproved verbs that might
 make them less discoverable. To find the commands with unapproved verbs, run th
e Import-Module command again with the
 Verbose parameter. For a list of approved verbs, type Get-Verb.
 Creating ChocolateyInstall as an environment variable (targeting 'Machine')
   Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
 WARNING: It's very likely you will need to close and reopen your shell
   before you can use choco.
 Adding Modify permission for current user to 'C:\ProgramData\chocolatey'
 We are setting up the Chocolatey package repository.
 The packages themselves go to 'C:\ProgramData\chocolatey\lib'
   (i.e. C:\ProgramData\chocolatey\lib\yourPackageName).
 A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'
   and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName
'.
 Creating Chocolatey folders if they do not already exist.
 WARNING: You can safely ignore errors related to missing log files when
   upgrading from a version of Chocolatey less than 0.9.9.
   'Batch file could not be found' is also safe to ignore.
   'The system cannot find the file specified' - also safe.
 Chocolatey v0.9.9.3
 This is try 1/3. Retrying after 300 milliseconds.
  Error converted to warning:
  Access to the path 'C:\ProgramData\chocolatey\choco.exe.old' is denied.
 This is try 2/3. Retrying after 400 milliseconds.
  Error converted to warning:
  Access to the path 'C:\ProgramData\chocolatey\choco.exe.old' is denied.
 Maximum tries of 3 reached. Throwing error.
 Attempting to delete choco.exe.old ran into an issue:
  Access to the path 'C:\ProgramData\chocolatey\choco.exe.old' is denied.
 Chocolatey is unpacking required files for use. Overwriting? True
 false : The term 'false' is not recognized as the name of a cmdlet, function, s
cript file, or operable program. Check t
 he spelling of the name, or if a path was included, verify that the path is cor
rect and try again.
 At C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1:24 char:17
 + $overrideArgs = false
 +                 ~~~~~
     + CategoryInfo          : ObjectNotFound: (false:String) [], CommandNotFoun
dException
     + FullyQualifiedErrorId : CommandNotFoundException
 false : The term 'false' is not recognized as the name of a cmdlet, function, s
cript file, or operable program. Check t
 he spelling of the name, or if a path was included, verify that the path is cor
rect and try again.
 At C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1:27 char:13
 + $forceX86 = false
 +             ~~~~~
     + CategoryInfo          : ObjectNotFound: (false:String) [], CommandNotFoun
dException
     + FullyQualifiedErrorId : CommandNotFoundException
 WARNING: The names of some imported commands from the module 'chocolateyInstall
er' include unapproved verbs that might
 make them less discoverable. To find the commands with unapproved verbs, run th
e Import-Module command again with the
 Verbose parameter. For a list of approved verbs, type Get-Verb.
 Chocolatey (choco.exe) is now ready.
 You can call choco from anywhere, command line or powershell by typing choco.
 Run choco /? for a list of functions.
 You may need to shut down and restart powershell and/or consoles
  first prior to using choco.
chocolatey upgrade not successful.
Error while running 'C:\ProgramData\chocolatey\lib\chocolatey\tools\chocolateyIn
stall.ps1'.
 See log for details.
 Unsuccessful operation for chocolatey.
  Do you want to rollback to previous version (package files only)?
 1) yes [Default - Press Enter]
 2) no

Oops.

@Taomyn
Copy link
Author

Taomyn commented Mar 30, 2015

I also had to manually restore from backup the Chocolatey folder from ProgramData as the rollback didn't work - I couldn't figure out how to force reinstall the previous version.

@nyn3x
Copy link

nyn3x commented Mar 30, 2015

Other packages (like nodejs, autohotkey ...) seem to fail as well; "The term 'false' is not recognized as the name of a cmdlet ..."

@VonOx
Copy link

VonOx commented Mar 30, 2015

Solution in issue #216

ferventcoder referenced this issue Mar 30, 2015
* Set $installArguments to the environment variable
* Set $forcex86 to the environment variable
* Set $packageParameters to the environment variable
* Set $overrideArgs to the environment variable
@ferventcoder ferventcoder added this to the 0.9.9.4 milestone Mar 30, 2015
@ferventcoder ferventcoder self-assigned this Mar 30, 2015
@ferventcoder
Copy link
Member

Apparently I missed testing this change with POSH v4. I just made the fixes and tested against POSH v2 and v4. 0.9.9.4 incoming

@ferventcoder ferventcoder changed the title Can't upgrade to Chocolatey 0.9.9.3 Can't upgrade to Chocolatey 0.9.9.3 - the term 'false' is not recognized Mar 30, 2015
@ferventcoder ferventcoder changed the title Can't upgrade to Chocolatey 0.9.9.3 - the term 'false' is not recognized Can't upgrade to Chocolatey 0.9.9.3 - The term 'false' is not recognized as the name of a cmdlet Mar 30, 2015
ferventcoder added a commit that referenced this issue Mar 30, 2015
A regression introduced in
abe92f3
which is just in 0.9.9.3 that was attempting to solve other issues
caused choco to stop working completely in some versions of PowerShell,
which have stricter requirements for setting booleans.

Without this fix, chocolatey will continue to be unusable
ferventcoder added a commit that referenced this issue Mar 30, 2015
* stable:
  (version) 0.9.9.4
  (doc) update changelog / nuspec
  (GH-207) pass switches correctly
  (GH-215) The term 'false' is not recognized
@ferventcoder
Copy link
Member

And it's out.

@nvivo
Copy link

nvivo commented Mar 30, 2015

Just for reference, 0.9.9.4 works, but I couldn't upgrade due to the same bug. =)

I had to do reinstall chocolatey 0.9.8.33 using the commands on chocolatey.org frontpage, then do a choco upgrade chocolatey -force to grab the latest version again.

@Taomyn
Copy link
Author

Taomyn commented Mar 30, 2015

@nvivo did you still have the broken 0.9.9.3? i had to restore 0.9.9.2 from a backup and then I was able to upgrade to 0.9.9.4 without issue

@ferventcoder btw, thanks for the prompt action on this

@JohnLudlow
Copy link

@nvivo @Taomyn @ferventcoder

I had the broken 0.9.9.3, and @nvivo's suggestion worked (though I did a couple of things slightly differently).

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

_NB: I did this by clicking the little copy button on the page_

  • Paste into an administrative command prompt. - v0.9.8.33 will install
  • Run this command: chocolatey install chocolatey - This will install 0.9.9.4.
  • Run this command: chocolatey upgrade chocolatey - This should succeed without doing anything (but it's a nice test)

@ferventcoder thanks for the quick response

@ferventcoder
Copy link
Member

Not documented much of anywhere, but if you want the absolute latest version (including prereleases), you can run this command instead:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/InstallAbsoluteLatest.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

@nyn3x
Copy link

nyn3x commented Mar 30, 2015

@Taomyn

I just looked at the changes made to fix the "bug" (45ca627), and I applied the modifications to the broken 0.9.9.3 install. Then I could just fine upgrade to 0.9.9.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants