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

error win10 #8426

Closed
xuhaihui opened this issue Mar 13, 2018 · 12 comments
Closed

error win10 #8426

xuhaihui opened this issue Mar 13, 2018 · 12 comments

Comments

@xuhaihui
Copy link

use composer

[ErrorException]
proc_open(NUL): failed to open stream: No such file or directory

I don't know how to solve this problem

@johnstevenson
Copy link
Member

This error has come up a couple of times recently here (#7083, #7112) and also on Git for Windows (git-for-windows/git#1554) where it can manifest as a crash or a bash: /dev/null error.

It is a Windows configuration error that could be caused by almost anything (perhaps even failed or badly behaving Windows updates?). The bottom line is that the Windows service that handles output to nul is either not installed or has not been enabled.

Open a Command Prompt as an admin and type sc query null. On Windows 10 you should see something like this:

SERVICE_NAME: null
        TYPE               : 1  KERNEL_DRIVER
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

If you get an error message saying The specified service does not exist as an installed service. then you are probably going to have to reinstall (or reset) the operating system.

If the STATE line does not say RUNNING then you can try and start it by typing sc start null, which may or may not work, depending on whether it has been stopped or simply not started.

You need to make sure that this service runs at start-up and you can see how it is configured by typing typing sc qc null

SERVICE_NAME: null
        TYPE               : 1  KERNEL_DRIVER
        START_TYPE         : 1   SYSTEM_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   :
        LOAD_ORDER_GROUP   : Base
        TAG                : 1
        DISPLAY_NAME       : Null
        DEPENDENCIES       :
        SERVICE_START_NAME :

If it is set up correctly you will see SYSTEM_START as the START_TYPE. If not you must type:

sc config null start= system

You will need to restart the computer for this to take effect (ie. if your attempt to start the service had failed).

@Seldaek Seldaek closed this as completed Apr 12, 2018
@Tjark-Kuehl
Copy link

So I'm currently having exactly the same issue but also exactly the same console output as seen in the solution. That means its not misconfigured right?

@ozgurg
Copy link

ozgurg commented Apr 25, 2019

@johnstevenson The solution worked! Thanks a lot.

@johnstevenson
Copy link
Member

@OzgurGorgulu That's great to know.

@ghost
Copy link

ghost commented Jul 4, 2019

@johnstevenson I'm having the same issue as @Tjark-Kuehl . My output is exactly the same as your in the solution but I still get the error.
Also it only happens in folders that have "composer.json" in it. If I just do "composer" on Desktop it works.

@osirion
Copy link

osirion commented Oct 25, 2019

If you're using Remote Profiles / Folder redirection - this issue will occur if you're redirecting to a remote %appdata% location. Change it to local and it will work.

@isheraz
Copy link

isheraz commented Nov 4, 2019

This is probably one of the 3 issues if your using windows 10.
1- Php version below 7.2
2- Window null issue mentioned by above
3- Ur Project is in One Drive and the File System is not supported.

I solved it by moving the project out of the One Drive Directory.

xy2z referenced this issue in xy2z/composer Nov 12, 2019
* Debug: display used authentication for http calls

* Command::execute() should always return an integer.

* Check that if the getUrlMatches method returns an empty value which means the path is incorrect

* Test to check there is a RuntimeException thrown when a path repository doesn't exist

* Add details of the path to aid debugging

* Remove extra line in method following CS-Fixer

* Remove unused variable

* added package homepage information to the command 'show'

* changed homepage information position

* Consider replaces when checking package dependents

* Remove invalid array keys

* Fix misc phpdoc and strpos arg order nits

https://www.php.net/strpos has the signature
`strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) : int`
(The needle is usually the constant)

`strpos('/', $suggestion)` would only be `false` for `''` and `'/'`

So the existing check would just not suggest **anything** that was
already installed (from pecl, built-in, or composer).

The intent seems to be to not suggest non-vendored php packages
that were already installed. (b20cc22)

* Added comment why source link check is necessary

* Add option to disable the lock file

When the `lock` option is set to false, composer will not write a
`composer.lock` file to disk. This signals that the package is meant
to be developed with unlocked and always updated dependencies. At the
moment, both `install` and `update` are allowed to install the
dependencies for such a package. If composer#6822 is implemented, only `update`
should be used for packages without a lockfile.

composer#8354

* Add tests for installer with lock: false

composer#8354

* Added clear cache for windows, fix tests

* Don't necessarily mention Google

There's other search engines as well.

* Add messages to junction tests to see failures

* HgDriver: don't run command in non-existing directory

* Add Windows proc-open errors to troubleshooting.md

As per these issues:

https://github.com/composer/composer/issues/7186
composer#8152

* Fix composer outdated command on PHP 7.4; fixes composer#8346

* Avoid calling findPackage for non-platform packages

* Update safeguard code, fixes composer#8383

* 5.3 support :/

* Fix require command to allow working on network mounts, fixes composer#8231

* Validate schema name, type and version

* Added phpdoc for ComposerAutoloaderInit$SHA1::getLoader() (composer#8393)

* Don't show root warning for docker containers

Signed-off-by: Viacheslav Sychov <viacheslav.sychov@gmail.com>

* Validate composer show with --tree and --path options set (composer#8390)

* make optimized autoloader respect PSR standards

* Move test file parsing into try/catch block to avoid phpunit swallowing errors

* Avoid clearing the error output during removeDirectory execution, losing git error output, fixes composer#8351

* Fix gitlab support for basic-auth fallback from ssh URLs

* Fix github auth to try https with pwd also, fixes composer#8356

* Avoid overwriting credentials with existing ones from git repos, refs composer#8293

* Remove credentials from git remotes in cache and vendor dirs

This only removes the credentials if they are managed by composer auth.json or equivalent, if the credentials were present in the package URL to begin with they might remain

Refs composer#8293
Fixes composer#3644
Closes composer#3608

* Fix output of dump-autoload command to avoid interfering with warnings, refs composer#8397

* Change PSR-fix for optimized autoloader to only warn for now, refs composer#8397

* Fix tests for PSR-fix in optimized autoloader, refs composer#8397

* Fix tests for PSR-fix in optimized autoloader, refs composer#8397

* Fix PSR warnings for optimized autoloader, refs composer#8397, refs composer#8403

* Output a hint that maybe you are not in the right directory, fixes composer#8404

* Prepare 1.9.1 changelog

* Fix PSR warnings for optimized autoloader, refs composer#8397, refs composer#8403

* Update dependencies

* Fix: Xdebug vs xdebug

* Fix: Add environment variables related to Xdebug to documentation
@MeesterDaaf
Copy link

Thank you so much @isheraz. The OneDrive issue solved it. My students will be very happy....

@alcohol alcohol transferred this issue from composer/composer Nov 13, 2019
@alcohol alcohol transferred this issue from composer/windows-setup Nov 13, 2019
@S-Tian86
Copy link

This is probably one of the 3 issues if your using windows 10.
1- Php version below 7.2
2- Window null issue mentioned by above
3- Ur Project is in One Drive and the File System is not supported.

I solved it by moving the project out of the One Drive Directory.

Thank you so much @isheraz. The OneDrive issue solved it. My students will be very happy....

El proyecto siempre lo he tenido en la carpeta de One Drive, pero ahora después de que actualicé Windows a la version 1909 me falló. Moví el proyecto a otra carpeta y volvió a funcionar. Muchas gracias.

@stof
Copy link
Contributor

stof commented Mar 20, 2020

Note that Google Drive can cause the same kind of issues that OneDrive.

@yangjiafei
Copy link

This problem i have solved. find the system file 'C:/windows/system32/drivers/null.sys'. use other right file replace it. My system is win10,After I installed the wamp3 (but it no run). Compoer can't be used. It say 'proc_open(NUL): failed to open stream: No such file or directory'. At the same time, git bash automatically close when i open it. never can open for more than three seconds, and the file mintty.exe.stackdump be created in the folder where i open the git bash. after i replace the null.sys use a new one, 'sc query null ' display STATE is RUNNING.

This is reference material : https://www.jianshu.com/p/1642eedab81b

@carouselcarousel
Copy link

This problem i have solved. find the system file 'C:/windows/system32/drivers/null.sys'. use other right file replace it. My system is win10,After I installed the wamp3 (but it no run). Compoer can't be used. It say 'proc_open(NUL): failed to open stream: No such file or directory'. At the same time, git bash automatically close when i open it. never can open for more than three seconds, and the file mintty.exe.stackdump be created in the folder where i open the git bash. after i replace the null.sys use a new one, 'sc query null ' display STATE is RUNNING.

This is reference material : https://www.jianshu.com/p/1642eedab81b

Is there anyone who have the null.sys which needs to be changed? File has been removed.

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices
NUL = \Device\Null

When I try to run "sc start null"
[SC] StartService FAILED 1058:
The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.

Also tried creating the folders but diddn't worked.
C:\dev\null
C:\Program Files\git\dev\null

I have the same problem (After windows update). It's worked before. Now can't even isntall the latest version Git-2.41.0.3-64-bit.exe .

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

No branches or pull requests