I'm building my first project in Laravel and trying to use Elixir, using homestead on Windows 8.1. I've hit the known npm/vagrant issue of too-long-path-names: https://harvsworld.com/2015/how-to-fix-npm-install-errors-on-vagrant-on-windows-because-the-paths-are-too-long/

So I made the one line edit recommended in that article (thank god for that guy), and then ran (with and without sudo): npm install --no-bin-links

It's moved me ahead so now I get two different kinds of errors: some 'Missing write access' errors, and a bunch of "EACCES" errors:

错误输出为我提供了清道夫搜寻的下一条线索(我认为):

That brings me to this post, but the difference for me is there's no change even after I use sudo (or update my user permissions like so):

sudo chown -R $USER /usr/local

数道周-R$(Whami)~/.npm

Update: then after the suggestion below I get EPROTO and EXTXTBSY errors (even after following the prompted suggestion to rename the npm-debug.log back: enter image description here

So I tried running gulp to see if it would give me clues, and error output had me do:

sudo npm rebuild node-sass

运行时出现相同的EPROTO和ETXTBSY错误,npm-debug.log文件显示: 错误事件:协议错误,符号链接‘../NODE-SASS/BIN/NODE-SASS’->‘/home/vagrant/Code/Family-laravel/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/.bin/node-sass’

然后,在做了一个小时的其他工作后,我重新开始了这些步骤,这次错误减少了:

  • sudo npm -g install npm@latest (fine)

  • sudo npm安装——没有bin链接(只有ETXTBSY错误和任务"sass"中插件"运行序列"中的错误)

  • SUDO NPM重建node-sass--no-bin-link(没有错误!)

  • gulp (只有一个错误:未找到:通知发送)

越来越近了!

推荐答案

I have been trying to figure out this problem for weeks. Here is what I did to make it work without using my host environment:

I updated node to the latest version in homestead according to nodesource.com:

sudo apt-get install --yes nodejs
curl --silent --location https://deb.nodesource.com/setup_4.x | sudo bash -

我在homestead中将npm更新为最新版本.这应该在更新 node 后完成:

sudo npm -g install npm@latest

我在laravel项目目录中运行了npm install.我还必须强制安装所有依赖项:

sudo npm install --no-bin-links
sudo npm cache clear
sudo npm install --force --no-bin-links

我根据一个错误重新构建了 node sass:

sudo npm rebuild node-sass --no-bin-links

During this whole process if something fails or after each install, i used:

sudo npm cache clear

我的主机是windows 10,有最新的virtualbox、最新的vagrant、最新的homestead.我使用git-bash作为管理员,并使用git-bash将ssh转换为vagrant.

到目前为止,我只测试并确认我的gulp 起作用了.可能需要重新构建其他依赖项.

希望这能有所帮助!

Laravel相关问答推荐

无法在终端cPanel中打开输入文件:artisan

在Laravel Sail Docker环境中的PHPMyAdmin中出现`Out of Memory‘错误

如何使用 laravel 更新单个值

Laravel 获取具有多对多关系的中间表数据

前端和管理员分开时未加载laravel 9中间件

1 子编译中的警告(使用'stats.children:true'和'--stats-children'了解更多详细信息)

将数据从控制器传递到 Laravel 中的视图

如何访问 Validator::extend 中的其他输入属性?

指令allow_call_time_pass_reference警告

如何在使用 Laravel 在控制器中发送邮件之前更改邮件配置?

函数 mcrypt_get_iv_size() 在 Laravel 4 上已弃用

如何在 Laravel 中实现自己的 Faker 提供程序

在 laravel 6.0 中未定义命令ui

在 Laravel 中,如何获取 *only* POST 参数?

Laravel / Eloquent内存泄漏重复检索相同的记录

如何在laravel 5.1中使用url(路由)传递多个参数

升级到 laravel 5.3 后错误 datetime format: 1292 Incorrect datetime value: '0000-00-00 00:00:00'

Laravel 验证 pdf mime

Select,where JSON 包含数组

Laravel 验证存在于不存在的地方