Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Awakenweb's avatar

Cannot install Elixir on Homestead

Hi everyone,

I'm running Windows 8.1 on my desktop, and, as it seems to be a pain in the neck to install Elixir on this particular platform, I tried to install it directly on my Homestead instance.

When I run sudo npm install in the appropriate folder, I'm blocked after a few minutes by a rather cryptic error message : Error: UNKNOWN, symlink '../user-home/cli.js' I get the same exact error when installing Gulp alone.

Does anyone had this problem or has a solution to it?

complete error message is here :

npm WARN package.json @ No repository field.
npm ERR! Error: UNKNOWN, symlink '../user-home/cli.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>
npm ERR! System Linux 3.13.0-30-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/vagrant/Code/myProjectFolder
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path ../user-home/cli.js
npm ERR! code UNKNOWN
npm ERR! errno -1
npm ERR! not ok code 0
0 likes
19 replies
Awakenweb's avatar

Thanks for your answer, it resolved my first problem, but I get another cryptic error message now :

npm WARN package.json @ No repository field.
npm ERR! Error: EPERM, open '/home/vagrant/Code/myProjectFolder/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/test/sass-spec/spec/extend-tests/104_test_nested_extender_counts_extended_subselectors/104_test_nested_extender_counts_extended_subselectors/expected_output.css' 
npm ERR! { [Error: EPERM, open '/home/vagrant/Code/myProjectFolder/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/test/sass-spec/spec/extend-tests/104_test_nested_extender_counts_extended_subselectors/104_test_nested_extender_counts_extended_subselectors/expected_output.css'] 
npm ERR! errno: 50, 
npm ERR! code: 'EPERM',
npm ERR! path: '/home/vagrant/Code/myProjectFolder/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/test/sass-spec/spec/extend-tests/104_test_nested_extender_counts_extended_subselectors/104_test_nested_extender_counts_extended_subselectors/expected_output.css' } 
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.13.0-30-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "--no-bin-links"
npm ERR! cwd /home/vagrant/Code/myProjectFolder
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path /home/vagrant/Code/myProjectFolder/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/test/sass-spec/spec/extend-tests/104_test_nested_extender_counts_extended_subselectors/104_test_nested_extender_counts_extended_subselectors/expected_output.css 
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, open /home/vagrant/Code/myProjectFolder/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/test/sass-spec/spec/extend-tests/104_test_nested_extender_counts_extended_subselectors/104_test_nested_extender_counts_extended_subselectors/expected_output.css' 
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/vagrant/Code/myProjectFolder/npm-debug.log
npm ERR! not ok code 0
Ingram's avatar

I was having the same issue. When I tried to follow the last path in Windows and create a new file with that name, it claimed that the path is too long.

After that I tried moving my project directory to C:\ to shorten the path and after that npm install successfully finished.

huglester's avatar

try this:

alias npm='npm --no-bin-links'

This should be added to your .bashrc or something file. re-login to VM and you should be good to go.

I think it should solve your problem, since I had the same one

Awakenweb's avatar

@Huglester: This has actually already been done (see first answer on this post).

@Ingram; I also suspects this is a conflict between Windows' filesystem and Linux' one. NPM is a good thing, you don't have to reinvent the wheel. But for me it has a huge drawback: the way it manages dependencies forces you to install tire and rim factories alongside the wheel.

I wanted to save time by using Gulp, I ended up porting it to PHP. In the end, it took me a lot less time than trying to figure out what the problem was.

It just lacks the asynchronous workflow of Gulp (i'm working on it), a bunch of unit tests, and lots of plugins (of course).

1 like
huglester's avatar

@akenweb well, for me the --bin part did not work, it only solved half of a problem. What solved it for me is that I created the alias. Reloged into the homestead vm and voila!

Ingram's avatar
Ingram
Best Answer
Level 3

@Awakenweb It's definitely something with Windows (and VirtualBox). Right now moving the directories closer to the root in Windows seems to fix the issue (so it will snugly fit into the 260 character limit); although I agree, the dependency system for npm is flawed. Also it is a ticking time bomb -- one day the chain of dependencies will become longer than the 260 characters and this will break for good.

Beverage seems interesting solution to this, but as mentioned on the website, packages for PHP are outdated. I do hope that they will eventually fix npm dependency management issues so that we wouldn't have to resort to things like creating the same command-line tool in a different language -- it makes more sense to focus all efforts on maintaining one implementation of it and the ecosystem for Gulp is already there.

freddy96's avatar

Hey Try a tool instead, Its name is LongPathTool..

lprice's avatar

Inside your project folder run the following:

alias npm='npm --no-bin-links'

then run "npm update" also inside your project folder. That will install also gulp but only to the project.

You can also install gulp globally: npm install --global gulp

That should work, and now you can run "gulp watch"

ovidiu_dtp's avatar

I have the same problem. I still can't figure out how to solve it...

Ingram's avatar

We worked on fixing this in Vagrant and it was merged yesterday, which means that starting from 1.7.3 you do not need this fix.

MarkLL's avatar

A big thanks to @EliasSoares !

Once I restarted the VM (Vagrant up from the Homestead directory) and as long as I include --no-bin-links it now works.

1 like
SERVANT14's avatar

@EliasSoares That worked well for me. I was able to get by without the --no-bin-links option for now at least. One additional thing I had to do was remove a mount to a mapped network drive. This solution doesn't work with those. So I

  1. made the Ruby change,
  2. commented out the mapped drive to a Windows mapped drive,
  3. booted up the box, ran npm install with success,
  4. halted the box,
  5. reverted the Ruby change,
  6. uncommented the Windows mapped drive,
  7. booted the box.
HimJiggins's avatar

I had the same problem and ended up installing and running npm and gulp through windows on the shared directory.

Please or to participate in this conversation.