[英]Rails Angular webpack foreman
我使用此命令創建了一個新的Rails應用
rails new anrails --webpack=angular -d postgresql -T
除了這些警告和錯誤之外,
warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
warning "rails-erb-loader@5.0.2" has incorrect peer dependency "webpack@2".
An unexpected error occurred: "EPROTO: protocol error, symlink '../acorn/bin/acorn' -> '/vagrant/Sites/anrails/node_modules/acorn-dynamic-import/node_modules/.bin/acorn'".
warning "webpack-dev-middleware@1.11.0" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
warning "webpack-dev-server@2.5.1" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0".
error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../multicast-dns/cli.js' -> '/vagrant/Sites/anrails/node_modules/bonjour/node_modules/.bin/multicast-dns'".
我收到消息:Webpacker已成功安裝。
然后,它安裝angular及其依賴項,並得到此錯誤
error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../json5/lib/cli.js' -> '/vagrant/Sites/anrails/node_modules/loader-utils/node_modules/.bin/json5'".
之后,我得到消息:Webpacker現在支持angular和Typescript。
所以我在應用程序的根文件夾中創建一個Procfile
web: bundle exec rails s -b 0.0.0.0
webpacker: bin/webpack-dev-server
並運行領班開始並獲得以下信息
09:40:39 web.1 | started with pid 4514
09:40:39 webpacker.1 | started with pid 4515
09:40:40 webpacker.1 | yarn run v0.27.5
09:40:40 webpacker.1 | error Command "webpack-dev-server" not found.
09:40:40 webpacker.1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
09:40:40 webpacker.1 | exited with code 1
09:40:40 system | sending SIGTERM to all processes
09:40:41 web.1 | terminated by SIGTERM
運行在Windows上的vagrant中,ruby 2.4.1p111,Rails 5.1.2,node 6.11.1,yarn 0.27.5
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.