无法在位置写文件:to://app.js(Laravel 9 Composer在登台站点上更新)

发布于 2025-02-04 17:43:51 字数 1296 浏览 2 评论 0原文

因此,我只是在一个正在处理的应用程序的登台网站上运行了一个作曲家更新程序,并且在作曲家生成了它的软件包清单之后,我会遇到此错误:

> @php artisan vendor:publish --tag=laravel-assets --ansi --force

   League\Flysystem\UnableToWriteFile 

  Unable to write file at location: to://app.js.

  at vendor/league/flysystem/src/UnableToWriteFile.php:24
     20▕     private $reason;
     21▕ 
     22▕     public static function atLocation(string $location, string $reason = '', Throwable $previous = null): UnableToWriteFile
     23▕     {
  ➜  24▕         $e = new static(rtrim("Unable to write file at location: {$location}. {$reason}"), 0, $previous);
     25▕         $e->location = $location;
     26▕         $e->reason = $reason;
     27▕ 
     28▕         return $e;

      +24 vendor frames 
  25  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()
Script @php artisan vendor:publish --tag=laravel-assets --ansi --force handling the post-update-cmd event returned with error code 1

我尝试使用php php工匠存储来重建符号链接:link 成功,但仍然存在相同的错误。我还运行了npm运行dev,然后完成并创建了app.js(在public/js/以及我的其他JS文件中为此项目)。我也只有php手工艺品供应商:发布-tag = laravel-assets -ansi -force,正如我所期望的那样,我会遇到相同的错误。

我认为这需要解决,尽管一切似乎是正确的,但一切都可以正常工作吗?那么,我需要做什么才能删除此错误?

谢谢

So I just ran a composer updater on a staging site for an app I'm working on and i get this error after composer has generated it's package manifest:

> @php artisan vendor:publish --tag=laravel-assets --ansi --force

   League\Flysystem\UnableToWriteFile 

  Unable to write file at location: to://app.js.

  at vendor/league/flysystem/src/UnableToWriteFile.php:24
     20▕     private $reason;
     21▕ 
     22▕     public static function atLocation(string $location, string $reason = '', Throwable $previous = null): UnableToWriteFile
     23▕     {
  ➜  24▕         $e = new static(rtrim("Unable to write file at location: {$location}. {$reason}"), 0, $previous);
     25▕         $e->location = $location;
     26▕         $e->reason = $reason;
     27▕ 
     28▕         return $e;

      +24 vendor frames 
  25  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()
Script @php artisan vendor:publish --tag=laravel-assets --ansi --force handling the post-update-cmd event returned with error code 1

I tried to rebuild the symbolic links with php artisan storage:link which was successful but still have the same error. I have also ran npm run dev and this finished too and created app.js (in public/js/ along with my other js files for this project). I have also just ran php artisan vendor:publish --tag=laravel-assets --ansi --force and as I expected I get the same error.

I assume this needs to be resolved for everything to work right despite it appearing to be correct? So what would I need to do to remove this error?

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一枫情书 2025-02-11 17:43:51

我在帆/码头机上也有类似的问题,
夹的所有权。

我已经通过更改文件

sudo chown -R $USER:$USER ./vendor/ ./public/vendor

I had a similar issue with Sail/Docker,
I've fixed it by changing the ownership of the folder ./vendor and ./public/vendor to my user

In my WSL connexion and my project folder, I've ran:

sudo chown -R $USER:$USER ./vendor/ ./public/vendor
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文