在我的项目中,我使用 Angular6 作为前端。现在我要做的是将远程服务器中的项目部署到实际服务器中。我首先使用npm run build -prod
命令来构建前端。但是我无法构建我的项目,因为以下错误一次又一次发生,
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! Trackit-Revamp@6.0.0 build: `ng build --prod --build-optimizer --aot`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the Trackit-Revamp@6.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Indrajith.E\AppData\Roaming\npm-cache\_logs\2019-08-22T08_41_00_271Z-debug.log
Run Code Online (Sandbox Code Playgroud)
我在C:\Users\Indrajith.E\AppData\Roaming\npm-cache\_logs\2019-08-22T08_41_00_271Z-debug.log
文件路径中的错误日志包含与上述相同的错误详细信息。
我该如何解决这个问题?
我是React新手,我很困惑,日夜不停地思考它,几乎所有的头发都掉下来了,而且还在掉下来,这就是为什么我们在使用类创建组件时总是扩展 React.Component类。
但在功能组件和其他方法中,我们不会做任何这样的事情来将创建的组件推送到React.Component类中。所以主要问题是,什么是React.Component类,为什么我们总是使用extends将新组件作为子组件添加到它,以及为什么我们不能在不使用类组件中的扩展或不扩展React.Component类的情况下在 React Native 中创建组件。那么,React.Component类在幕后的React内部发生了什么,场景是什么?
我将非常非常感谢那个用例子和简单的方法回答我的问题的人。
这是我第一次进行测试,并且获得了测试UI组件的技巧。现在,我正在尝试测试其中包含一些静态方法的类。它也包含参数。
见上课:
import UserInfoModel from '../models/UserInfo.model';
import ApiClient from './apiClient';
import ApiNormalizer from './apiNormalizer';
import Article from '../models/Article.model';
import Notification from '../models/Notification.model';
import Content from '../models/Link.model';
export interface ResponseData {
[key: string]: any;
}
export default class ApiService {
static makeApiCall(
url: string,
normalizeCallback: (d: ResponseData) => ResponseData | null,
callback: (d: any) => any
) {
return ApiClient.get(url)
.then(res => {
callback(normalizeCallback(res.data));
})
.catch(error => {
console.error(error);
});
}
static getProfile(callback: (a: UserInfoModel) => void) {
return ApiService.makeApiCall(`profile`, ApiNormalizer.normalizeProfile, …
Run Code Online (Sandbox Code Playgroud) 我正在docker中运行Nginx。HTTPS工作正常,但是当我明确发出HTTP请求时,出现以下错误
400错误的请求普通的HTTP请求已发送到HTTPS端口
nginx.conf如下
worker_processes auto ;
events {}
http {
include /etc/nginx/mime.types;
access_log /var/log/nginx/main.access.log;
server {
listen 80;
location / {
return 301 https://localhost:3000$request_uri;
}
}
server {
listen 443 ssl;
server_name localhost:3000;
root /var/www/html;
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;
location / {
try_files $uri /index.html;
}
}
}
Run Code Online (Sandbox Code Playgroud)
我使用这个容器运行
docker run -p 3000:443 -it -d --name nginxtest nginx-test
Run Code Online (Sandbox Code Playgroud)
并得到以下错误
docker文件如下
FROM nginx:latest
COPY ./build /var/www/html
COPY ./nginx.conf /etc/nginx/nginx.conf
COPY ./ssl /etc/nginx/ssl
EXPOSE …
Run Code Online (Sandbox Code Playgroud) 如果SvelteJS将您代码中的所有内容都编译为纯JavaScript,那么这意味着第三方库的代码也将转换为纯JavaScript并消除了JavaScript框架的npm模块漏洞这一曾经存在的问题,或者我弄错了所有这些
这是我对DOM和浏览器如何工作的幼稚理解
每当DOM中的某些内容(真实dom)更改时,浏览器就会对该DOM重新绘制或重排。因此,用更简单的术语来说,每次DOM更改时,浏览器都需要重新计算CSS,进行布局并重新绘制网页。这是在真正的dom中花费时间的原因。
因此,React带有此虚拟DOM,它的实际作用是将更改批量进行批处理,然后调用一次将其应用于实际域。因此,最大程度地减少了回流和重涂。
那斯维尔特呢。如果直接操作DOM,它将如何控制浏览器的重绘/重排。
javascript ×4
reactjs ×3
npm ×2
svelte ×2
angular ×1
build ×1
deployment ×1
docker ×1
ecmascript-6 ×1
es6-class ×1
jestjs ×1
nginx ×1
nginx-config ×1
node.js ×1
react-native ×1
svelte-3 ×1
testing ×1
virtual-dom ×1