Homestead npm install --no-bin-links error

Published 1 week ago by psuned

I'm running VirtualBox 5.2.8 and Vagrant 2.0.3. I have a clean install of Laravel 5.5 with no preset as I'm looking to include Bootstrap 4 through npm.

While using npm 5.7.1, I can run npm install --no-bin-links and the installation goes successfully.

[email protected]:~/code/laravel$ npm -v
5.7.1
[email protected]:~/code/laravel$ npm install --no-bin-links

> [email protected] install /home/vagrant/code/laravel/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.8.3/linux-x64-57_binding.node
Download complete  ] - :
Binary saved to /home/vagrant/code/laravel/node_modules/node-sass/vendor/linux-x64-57/binding.node
Caching binary to /home/vagrant/.npm/node-sass/4.8.3/linux-x64-57_binding.node

> [email protected] postinstall /home/vagrant/code/laravel/node_modules/node-sass
> node scripts/build.js

Binary found at /home/vagrant/code/laravel/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1121 packages from 651 contributors in 62.208s

However, if I'm running npm 5.8.0. I get the following errors.

[email protected]:~/code/laravel$ npm -v
5.8.0
[email protected]:~/code/laravel$ npm install --no-bin-links
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/abbrev/package.json.1309035104'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/acorn/package.json.3443316621'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/acorn-jsx/package.json.4064037102'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/acorn-object-spread/package.j
son.268853687'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/acorn-object-spread/node_modules/acorn/pack
age.json.3753941998'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/alphanum-sort/package.json.28535536
13'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/acorn-jsx/node_modules/acorn/package.json.1
498362494'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/amdefine/package.json.3828707813'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/ansi-styles/package.json.1425961070'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/ansi-regex/package.json.2865381869'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/ansi-cyan/package.json.328853316'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/ansi-wrap/package.json.2766588469'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/ansicolors/package.json.2420525423'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/aproba/package.json.2202780556'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/ansi-red/package.json.2212754646'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/ansi-gray/package.json.613628141'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/arr-flatten/package.json.1526548324'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/archy/package.json.4017986242'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/arr-diff/package.json.2884842827'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/arr-union/package.json.2479437913'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/array-differ/package.json.3566148070
'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/array-each/package.json.2251689447'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/array-find-index/package.json.24
11276722'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/array-slice/package.json.3112020144'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/asap/package.json.1759445534'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/array-uniq/package.json.2696734562'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/arrify/package.json.3535746063'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/array-unique/package.json.3598081017
'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/asn1/package.json.2544016810'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/array-union/package.json.3732508550'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/ast-types/package.json.2693605565'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/assert-plus/package.json.3936529349'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/assign-symbols/package.json.493720
635'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/async-foreach/package.json.10381661
41'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/async/package.json.3185679984'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/atob/package.json.959441058'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/asynckit/package.json.508179596'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/async-each/package.json.300914463'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/aws-sign2/package.json.986982605'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/babel-plugin-add-
module-exports/package.json.815396691'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/babylon/package.json.3109833916'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/balanced-match/package.json.350854
6706'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/aws4/package.json.3394821958'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/base62/package.json.812797582'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/base64-js/package.json.2201991945'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/home/vagrant/code/laravel/node_modules/beeper/package.json.3353466455'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/asap):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ETXTBSY: text file is busy, rename '/home/vagrant/code/laravel/node_modules/asap/package.json.1759445534' -> '/home/vagrant/code/laravel/node_modules/asap/package.json'

npm ERR! path /home/vagrant/code/laravel/node_modules/acorn-object-spread/package.json.268853687
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename
npm ERR! ETXTBSY: text file is busy, rename '/home/vagrant/code/laravel/node_modules/acorn-object-spread/package.json.268853687' -> '/home/vagrant/code/laravel/node_modules/acorn-obj
ect-spread/package.json'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2018-04-12T17_59_34_391Z-debug.log
[email protected]:~/code/laravel$ exit
logout
Connection to 127.0.0.1 closed.

Anyone else seeing this?

ejdelmonico

Home uses your local file system project directory for the source code. You should be running npm install on your local file system projects directory(which ever one you defined in homestead.yml).

psuned
psuned
1 week ago (1,970 XP)

Sorry, I don't think that's what's causing my issue. I realize that you can run npm from the local machine and that it could be a workaround, but npm can run from Homestead too. I don't have npm installed locally and I prefer to run it from Homestead. It was successful for 5.7.1, but something with 5.8.0 seems to cause a problem and I'm curious if anyone else is seeing the same issue and perhaps knows why. Thanks for the response!

Cronix
Cronix
1 week ago (325,600 XP)

If you're running it while ssh'd into homestead, you don't need to use the --no-bin-links option as you're working on a linux os at that point.

psuned
psuned
6 days ago (1,970 XP)

I was thinking the same thing initially, but I was getting syslink errors if I didn't include it. I am running Homestead on a Windows 10 machine. Thanks for responding!

[email protected]:~/code/laravel$ npm -v
5.7.1
[email protected]:~/code/laravel$ npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! path ../semver/bin/semver
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink
npm ERR! EPROTO: protocol error, symlink '../semver/bin/semver' -> '/home/vagrant/code/laravel/node_modules/accord/node_modules/.bin/semver'


   ╭─────────────────────────────────────╮
   │                                     │
   │   Update available 5.7.1 → 5.8.0    │
   │     Run npm i -g npm to update      │
   │                                     │
   ╰─────────────────────────────────────╯


npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2018-04-16T20_02_45_195Z-debug.log
LiamHammett

Indeed, even if you're running it inside Homestead - if your files are volume mapped back up to your Windows host then you won't be able to symlink.

I've had more luck running with yarn instead of npm within the VM, again with the --no-bin-links flag, it seems to handle this scenario much more consistently.

Please sign in or create an account to participate in this conversation.