简体   繁体   English

分析composer.phar文件中的错误

[英]parse error in the composer.phar file

I was using Composer perfectly, but now when a try any command I got this error: 我曾经完美地使用过Composer,但是现在尝试任何命令时,我都收到此错误:

[Seld\\JsonLint\\ParsingException] [Seld \\ JsonLint \\ ParsingException]
"C:\\ProgramData\\ComposerSetup\\bin\\composer.phar" does not contain valid JSON “ C:\\ ProgramData \\ ComposerSetup \\ bin \\ composer.phar”不包含有效的JSON
Parse error on line 1: 在第1行上解析错误:
#!/usr/bin/env php< #!/ usr / bin / env php <
^ ^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[' 预期的值之一:“ STRING”,“ NUMBER”,“ NULL”,“ TRUE”,“ FALSE”,“ {”,“ [”

I already tried reinstall Composer, but nothing changes. 我已经尝试过重新安装Composer,但是没有任何变化。 Any idea?? 任何想法??

I had this issue and it took a while before it was fixed for me. 我遇到了这个问题,花了一段时间才为我解决。 Just in case other people find this topic i still want to provide the answer that fixed for me. 以防万一其他人找到此主题,我仍然想提供固定的答案。

I also use Windows + wamp but the mistake with in the environment variables..... i was stupid enough to create a "composer" environment variable DO NOT DO THIS or rename it to something else in case you did. 我也使用Windows + wamp,但是环境变量中的错误.....我很愚蠢,无法创建“ composer”环境变量。请勿这样做或将其重命名为其他名称,以防万一。

Found the answer here https://github.com/composer/getcomposer.org/issues/43 在这里找到答案https://github.com/composer/getcomposer.org/issues/43

After renaming it worked again. 重命名后,它又可以工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM