非常奇怪的错误,资产预编译在dev模式下工作得很好,但是一旦我做了生产模式,我就得到了错误:
root@53407ec15126:/app# RAILS_ENV=production rails assets:precompile
yarn install v1.22.18
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.04s.
yarn run v1.22.18
error Command "build" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
rails aborted!
jsbundling-rails: Command build failed, ensure yarn is installed and `yarn build` runs without errors
Tasks: TOP => assets:precompile => javascript:build
(See full trace by running task with --trace)
root@53407ec15126:/chinese-flashcards-app#最奇怪的是,我甚至不使用纱线在我的项目(我使用重要地图)。
发布于 2022-04-17 16:27:00
好吧..。我想出了怎么做猴子补丁(叹气)。
将此添加到package.json中
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "echo 1",
"build:css": "echo 1"
},这并不能解决rails prod预处理器使用纱线/npm处理器的问题(我不需要它们)。
https://stackoverflow.com/questions/71903502
复制相似问题