简体   繁体   English

NPM安装失败-fsevents

[英]NPM Install fails - fsevents

I'm unable to get npm installed correctly in my laravel project. 我无法在laravel项目中正确安装npm。 I'm running laravel on a vagrant box (ubuntu-trusty-64). 我在无业游民的盒子上运行laravel(ubuntu-trusty-64)。 When I run 'npm install' I get the first error in my pastebin (linked below). 当我运行'npm install'时,我的pastebin中出现了第一个错误(链接如下)。 I then found somewhere below that I should run it without symlinks when using a vagrant box on a windows host os so I then ran 'npm install --no-bin-links' and I was still getting the first error. 然后,我发现下面的某个地方在Windows主机操作系统上使用无业游民的盒子时应该在没有符号链接的情况下运行它,因此我运行了'npm install --no-bin-links',但我仍然遇到第一个错误。 So then with some help I ran 'rm -rf node_modules' then ran the 'npm install --no-bin-links' and it appears to work but hangs see second half of the pastebin. 因此,然后在一些帮助下,我运行了'rm -rf node_modules',然后运行了'npm install --no-bin-links',它似乎可以正常工作,但是挂起了pastebin的后半部分。

Please help! 请帮忙!

pastebin: https://pastebin.com/wuRkjqi6 pastebin: https//pastebin.com/wuRkjqi6

Update: 更新:

Just to update everyone on the status, I completely removed npm and reinstalled it following: 只是为了更新每个人的状态,我完全删除了npm并重新安装了以下代码:

https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

for node.js 8 对于node.js 8

I then ran 'sudo npm install --no-bin-links --verbose' directly from the host vm via virtualbox bypassing the vagrant ssh; 然后,我通过virtualbox绕过无聊的ssh直接从主机vm运行了“ sudo npm install --no-bin-links --verbose”。 but it still bombs out on me; 但是它仍然轰炸着我。 this time with an error. 这次出现错误。 but still surrounding fsevents. 但仍然围绕fsevents。

27990 info lifecycle vue@2.4.2~postinstall: vue@2.4.2
27991 verbose unlock done using /home/vagrant/.npm/_locks/staging-71408633a969dee2.lock for /home/vagrant/projects/MusekClub/node_modules/.staging
27992 verbose stack Error: ETXTBSY: text file is busy, rmdir '/home/vagrant/projects/MusekClub/node_modules/fsevents/node_modules'
27993 verbose cwd /home/vagrant/projects/MusekClub
27994 verbose Linux 3.13.0-125-generic
27995 verbose argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--no-bin-links" "--verbose"
27996 verbose node v8.2.1
27997 verbose npm  v5.3.0
27998 error path /home/vagrant/projects/MusekClub/node_modules/fsevents/node_modules
27999 error code ETXTBSY
28000 error errno -26
28001 error syscall rmdir
28002 error ETXTBSY: text file is busy, rmdir '/home/vagrant/projects/MusekClub/node_modules/fsevents/node_modules'
28003 verbose exit [ -26, true ]

Lastly I tried rebuilding the vagrant box from scratch this morning and when I re-ran 'sudo npm install --no-bin-links --verbose' from the virtualbox host I get the following: 最后,今天早上我尝试从头开始重新构建无聊的盒子,当我从virtualbox主机重新运行'sudo npm install --no-bin-links --verbose'时,我得到了以下信息:

vagrant@vagrant-ubuntu-trusty-64:~/projects/MusekClub$ sudo npm install
npm ERR! path /home/vagrant/projects/MusekClub/node_modules/fsevents/build/Release/.deps/User/eshanker/Code/fsevents/lib
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rmdir
npm ERR! ETXTBSY: text file is busy, rmdir '/home/vagrant/projects/MusekClub/node_modules/fsevents/build/Release/.deps/Users/eshanker/Code/fsevents/lib'

npm ERR! A complete log of this run can be found in:
npm ERR!    /home/vagrant/.npm/_logs/2017-08-09T12_45_58_590Z-debug.log

I removed the standard dependencies from the default laravel 5.4 package.json file. 我从默认的laravel 5.4 package.json文件中删除了标准依赖项。 I then installed each one, one by one. 然后,我一个接一个地安装每个。 I found that my issue only occurs when installing the "laravel-mix": "^1.0" dependency line. 我发现我的问题仅在安装“ laravel-mix”:“ ^ 1.0”依赖项行时发生。

I was able to overcome my issue by ditching npm and utilizing yarn. 通过抛弃npm并利用纱线,我能够解决我的问题。 Seems to get past the fsevents module as reading it as an optional dependency. 似乎超越了fsevents模块,将其作为可选依赖项读取。 Given what I've researched it appears that fsevents isn't supported on linux anyways. 根据我的研究,Linux似乎始终不支持fsevents。

vagrant@vagrant-ubuntu-trusty-64:~/projects/MusekClub$ sudo yarn install
yarn install v0.27.5
    Resolving packages...
    Fetching packages...
warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check.
Excluding it from installation.
    Linking dependencies...
    Building fresh packages...
Done in 67.15s.

npm install --no-optional帮助了我,但这只是在解决问题。

Using vagrant I was able to get around this by removing --node-bin-links and running my vagrant box as admin. 使用vagrant,我可以通过删除--node-bin-links并以管理员身份运行我的vagrant框来解决此问题。 I'm using roughly the same versions of node and npm. 我正在使用大致相同版本的node和npm。

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

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