运行时出现权限错误
ng build --prod --env=prod
Run Code Online (Sandbox Code Playgroud)
在 Docker 容器内。我想我正在处理所有各种 npm 配置设置,并且安装很好。但是当我运行时我收到此错误:
EACCES: permission denied, unlink '/home/node/rbs/dist/0.0b84f6ea259174c0238a.chunk.js'
Error: EACCES: permission denied, unlink '/home/node/rbs/dist/0.0b84f6ea259174c0238a.chunk.js'
at Object.fs.unlinkSync (fs.js:1061:18)
at rimrafSync (/home/node/rbs/node_modules/fs-extra/lib/remove/rimraf.js:254:15)
at options.readdirSync.forEach.f (/home/node/rbs/node_modules/fs-extra/lib/remove/rimraf.js:291:39)
at Array.forEach (<anonymous>)
at rmkidsSync (/home/node/rbs/node_modules/fs-extra/lib/remove/rimraf.js:291:26)
at rmdirSync (/home/node/rbs/node_modules/fs-extra/lib/remove/rimraf.js:281:7)
at Object.rimrafSync [as removeSync] (/home/node/rbs/node_modules/fs-extra/lib/remove/rimraf.js:252:7)
at Class.run (/home/node/rbs/node_modules/@angular/cli/tasks/build.js:29:16)
at Class.run (/home/node/rbs/node_modules/@angular/cli/commands/build.js:250:40)
at resolve (/home/node/rbs/node_modules/@angular/cli/ember-cli/lib/models/command.js:261:20)
at new Promise (<anonymous>)
at Class.validateAndRun (/home/node/rbs/node_modules/@angular/cli/ember-cli/lib/models/command.js:240:12)
at Promise.resolve.then.then (/home/node/rbs/node_modules/@angular/cli/ember-cli/lib/cli/cli.js:140:24)
at <anonymous>
Run Code Online (Sandbox Code Playgroud)
这是我的码头配置:
FROM node:8.11.3-alpine as build
RUN apk add --update python make
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=/home/node/.npm-global/bin:$PATH …Run Code Online (Sandbox Code Playgroud) 我在这里的几篇帖子中来回走动,还查看了Railscast的移动侦测(#199).我有一个rails3应用程序,它使用jquery和ajax和format.js并且工作正常.现在我正在尝试将应用程序扩展到移动设备.
我正在使用jquery mobile并且一切正常,但是当我在link_to上使用remote => true开关时,它不会将请求作为JS处理(它通常在桌面版本中执行).
这是链接代码:
<%= link_to 'Up', '/posts/' + String(rbpost.id) + '/upvote', :remote => true, :class => 'upvote', "data-role" => "button", "data-icon" => "arrow-u", "data-iconpos" => "notext" %>
Run Code Online (Sandbox Code Playgroud)
它以HTML格式处理
Started GET "/posts/3/upvote" for 127.0.0.1 at 2012-02-08 11:37:59 -0500
Processing by PostsController#upvote as HTML
Run Code Online (Sandbox Code Playgroud)
...并抱怨没有模板:
ActionView::MissingTemplate (Missing template posts/upvote, application/
upvote with {:handlers=>[:erb, :builder, :coffee], :formats=>[:mobile], :locale=
[:en, :en]}. Searched in:
* "C:/rubydemo/testapp/app/views"
):
app/controllers/posts_controller.rb:74:in `upvote'
Run Code Online (Sandbox Code Playgroud)
以下是事物的编码方式:
application_controller.rb:
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :adjust_format_for_mobile
private
# Set iPhone …Run Code Online (Sandbox Code Playgroud) 我正在使用play框架,并有一个抽象类:
abstract class Base{...}
Run Code Online (Sandbox Code Playgroud)
在伴随对象中有自己的隐式JSON编写器
object Base {
implicit val baseWrites: Writes[Base] = (...)(unlift(Base.unapply))
}
Run Code Online (Sandbox Code Playgroud)
我是这个抽象类的子类:
case class SubClass{...}
Run Code Online (Sandbox Code Playgroud)
在其伴随对象中也有自己的隐式JSON编写器
object SubClass {
implicit val subClassWrites: Writes[SubClass] = (...)(unlift(SubClass.unapply))
}
Run Code Online (Sandbox Code Playgroud)
当我尝试使用Json.toJson(SubClass)序列化子类对象时,我收到一个错误:
[error] both value subClassWrites in object SubClass of type => play.api.libs.json.
Writes[models.SubClass]
[error] and value baseWrites in object Base of type =>
play.api.libs.json.Writes[models.Base]
[error] match expected type play.api.libs.json.Writes[models.SubClass]
[error] Ok(Json.toJson(SubClass.find(id)))
Run Code Online (Sandbox Code Playgroud)
有没有办法消除歧义?
我无法弄清楚这里发生了什么 - 我已经包含了基于文档我认为正确的ngx-dropdown代码:
home.component.html
<div class="btn-group" dropdown>
<button dropdownToggle type="button" class="btn btn-primary dropdown-toggle">
Button dropdown <span class="caret"></span>
</button>
<ul *dropdownMenu class="dropdown-menu" role="menu">
<li role="menuitem"><a class="dropdown-item" href="#">Action</a></li>
<li role="menuitem"><a class="dropdown-item" href="#">Another action</a></li>
<li role="menuitem"><a class="dropdown-item" href="#">Something else here</a></li>
<li class="divider dropdown-divider"></li>
<li role="menuitem"><a class="dropdown-item" href="#">Separated link</a>
</li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
app.module.ts
@NgModule({
imports: [
BsDropdownModule.forRoot(),
...
]
Run Code Online (Sandbox Code Playgroud)
site.module.ts(这是包含主组件的模块)
@NgModule({
imports: [
BsDropdownModule,
Run Code Online (Sandbox Code Playgroud)
我正在使用angular-cli并且我已经包含了bootstrap样式:
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
Run Code Online (Sandbox Code Playgroud)
在index.html中我添加了一个片段让浏览器知道我正在使用bootstrap 4:
<script>window.__theme = 'bs4';</script>
<app-root>Loading . . .</app-root>
Run Code Online (Sandbox Code Playgroud)
出现按钮,控制台中没有显示错误.当我点击按钮("打开"和"显示"被添加到样式中)时,我可以看到dom发生变化.但是按钮下面没有任何东西打开 - 没有菜单显示.
我不知道在哪里可以看
angular ×2
ajax ×1
angular-cli ×1
bootstrap-4 ×1
docker ×1
implicits ×1
jquery ×1
json ×1
mobile ×1
scala ×1