thecodingmachine / nodejs-installer

An installer package that let's you install NodeJS and NPM as a Composer dependency.
107 stars 28 forks source link

tar: bin/npx: Cannot utime: Operation not permitted #35

Open delmicio opened 6 years ago

delmicio commented 6 years ago

Hi, I'm getting this error when using composer install:

Installing NodeJS v8.10.0                                                                                                                                                                               
  Downloading from https://nodejs.org/dist/v8.10.0/node-v8.10.0-linux-x64.tar.gz                                                                                                                        
Downloading (100%)tar: bin/npx: Cannot utime: Operation not permitted                                                                                                                                   
tar: bin/npm: Cannot utime: Operation not permitted                                                                                                                                                     
tar: Exiting with failure status due to previous errors                                                                                                                                                 

  [Mouf\NodeJsInstaller\NodeJsInstallerException]                                                                                                                                                       
  An error occurred while untaring NodeJS (vendor/node-v8.10.0-linux-x64.tar.gz) to vendor/nodejs/nodejs

I'm using this config:

"mouf": {
            "nodejs": {
                "version": "8.10.0",
                "forceLocal": true
            }
        }

BTW it was working when using root user but now I'm using a non roor user.

delmicio commented 6 years ago

Using composer run-script download-nodejs is the same error.

delmicio commented 6 years ago

Running composer run-script download-nodejs as root works OK.

Using docker and laradock.

moufmouf commented 6 years ago

Hey @delmicio !

Does it happen if you delete all your vendor directory before running "composer install" as non-root? Maybe some files in "vendor/nodejs/nodejs" already belong to the root user (and therefore composer as non-root cannot write in the directory?)

Let me know!

delmicio commented 6 years ago

Hi @moufmouf , I've tried againa with no vendor dir at all and the error is still there.

moufmouf commented 6 years ago

Sorry, but I really can't reproduce this error.

Could you let me know more about your OS? Linux? Windows? MacOS? Anything special with the file system? Is your current user the owner of all the project files?

faelgabriel commented 5 years ago

I am having the same problem.

This issue is happening using laradock with its default user without be root (laradock user), which is docker-composer.yaml with some containers already configured. Laradock: laradock.io

sampoturve commented 1 year ago

Bumped into this oldie this week so just reporting here just in case it helps someone.

Running macOS on M1 Macbook with Lando + Docker. No matter if ran with composer install or composer run-script download-nodejs, if there was vendor folder or not, which permissions were changed, the same error always appeared.

Installing NodeJS v19.5.0
  Downloading from https://nodejs.org/dist/v19.5.0/node-v19.5.0-linux-x64.tar.gz
Downloading (100%)tar: bin/corepack: Cannot open: Permission denied
tar: bin/npx: Cannot open: Permission denied
tar: bin/npm: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors

In NodeJsInstaller.php line 288:

  An error occurred while untaring NodeJS (vendor/node-v19.5.0-linux-x64.tar.gz) to vendor/nodejs/nodejs

Finally the culprit for this issue was the VirtioFS file sharing setting for Docker. Using gRPC FUSE works fine.

Screenshot 2023-01-27 at 15 31 25