Tag: yarnpkg

如何让Heroku识别子目录(而不是root)中的yarn.lock或package.json

我有一个使用React,Webpack和Yarn的Rails应用程序用于客户端。 我在/ client目录中拥有与客户端相关的所有内容。 这包括我的yarn.lock和package.json文件。 我有一个proc文件cds到/ client并正确运行yarn run build 。 这在本地工作,没有错误。 但是,当我部署/推送到Heroku时,我的推送被拒绝,我收到以下错误: remote: cd client && yarn run build:production remote: sh: 1: yarn: not found remote: rake aborted! remote: Command failed with status (127): [cd client && yarn run build:production…] 这对我说的是Heroku无法在根级别找到yarn.lock文件。 如何让Heroku在我的/ client目录下使用yarn.lock文件? 或者这个错误的原因是完全不同的?

如何从Rails应用程序中完全删除Yarn?

我正在使用jQuery和其他一些库构建一个Rails 5.1.x rails应用程序。 Rails坚持开Yarn,这在开发机器上很好,但我不能在生产中使用它。 有没有办法在没有导轨的情况下默认使用Yarn? 删除yarn.lock和node_modules以及随附的所有其他内容。

Heroku push – ExecJS :: RuntimeError:SyntaxError:期望的名称

我推送到Heroku时遇到以下错误。 前几天工作正常。 我正试图推送的提交没有重大配置更改。 我很难过如何解决这个问题。 Rails 5.1应用程序使用以下buildpack: 1. heroku/nodejs 2. heroku/ruby 我正在使用webpacker和纱线。 我认为这与它有关,但无法挖掘更多信息。 remote: —–> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: yarn install v0.27.5 remote: [1/4] Resolving packages… remote: [2/4] Fetching packages… remote: warning fsevents@1.1.2: The platform “linux” is incompatible with this module. remote: info “fsevents@1.1.2” is an optional dependency and […]

Rails资产管道使用字体和纱线

我有一个现有的rails应用程序,我正在一个单独的分支机构实施yarn来管理我的供应商资产。 我的应用程序堆栈是: ruby2.4.0 铁轨5.1.4 节点9.4.0 纱线1.3.2 安装yarn之后,我运行了yarn init ,它在项目根目录中生成了一个package.json。 添加几个包后,它看起来像: # package.json { “name”: “my-project-name”, “version”: “1.0.0”, “private”: true, “repository”: “my-repo”, “author”: “me”, “license”: “MIT”, “dependencies”: { “bootstrap”: “3”, “font-awesome”: “^4.7.0”, “jquery”: “^3.3.1”, “jquery-backstretch”: “^2.1.16”, “jquery-ujs”: “^1.2.2”, “waypoints”: “^4.0.1” } } 我在app / assets下创建了几个文件,用于包含来自node_modules样式表和javascripts: # app/assets/javascripts/node_modules.js //= require jquery //= require jquery-ujs //= require bootstrap/dist/js/bootstrap.min.js […]

通过纱线安装bootstrap的Rails无法找到字体

我有一个带有Bootstrap的Rails 5应用程序,我安装了纱线。 我做了以下事情: yarn add bootstrap bootstrap@^3.3.7: version “3.3.7” resolved “https://registry.yarnpkg.com/bootstrap/-/bootstrap-3.3.7.tgz#5a389394549f23330875a3b150656574f8a9eb71” 在application.css上 *= require bootstrap/dist/css/bootstrap 在application.js上 //= require bootstrap/dist/js/bootstrap //= require rails-ujs //= require @fnando/sparkline/dist/sparkline //= require_tree . 在assets.rb上 Rails.application.config.assets.paths << Rails.root.join('node_modules') Rails.application.config.assets.paths << Rails.root.join('node_modules/bootstrap/dist/fonts') Rails.application.config.assets.precompile << %r{node_modules/bootstrap/dist/fonts/[\w-]+\.(?:eot|svg|ttf|woff2?)$} 不过,当我在生产(Heroku)上访问它时,我得到了 ActionController::RoutingError (No route matches [GET] “/fonts/glyphicons-halflings-regular.ttf”): 我尝试添加$icon-font-path: “node_modules/bootstrap/dist/fonts”; 以及我的scss,但也没有奏效

Rails预编译资产未检测到Yarn可执行文件

我有一个Rails项目,我们从Rails 5.0转换为Rails 5.1.0。 当我尝试预编译资产时,我收到以下错误消息: Yarn executable was not detected in the system. Download Yarn at https://yarnpkg.com/en/docs/install 我从互联网搜索中读到的一切都说纱线和网络包装器附带Rails 5.1。 我从检查rails版本得到以下内容。 $rails –version Rails 5.1.0 我该如何解决? 我也想知道发生了什么。