嗨我在chrome控制台中遇到以下错误:
Uncaught TypeError: _firebase2.default is not a constructor
Run Code Online (Sandbox Code Playgroud)
当我在Fire.vue(webpack vue-loader)组件中使用以下代码时:
var db = new Firebase(this.rootUrl)
Run Code Online (Sandbox Code Playgroud)
这是我的Fire.vue的完整代码:
<template lang="jade">
h2 Hello from: {{ component_name }}
</template>
<script>
import Vue from 'vue'
import Firebase from 'firebase'
Vue.prototype.$consoleLog = function (args) { console.log(args) }
export default {
props: {
rootUrl: {
default: 'https://boiling-heat...', // here will be url of database
type: String
}
},
data () {
return {
component_name: 'Firebase component!'
}
},
ready () {
var db …Run Code Online (Sandbox Code Playgroud) 如何使用 nodejs(node-xlsx) 从 excel 中仅读取 A 列值?请指教。读取所有列值后,然后循环从其他来源进行搜索。
var xlsx = require('node-xlsx');
var obj = xlsx.parse(__dirname + '/test.xlsx');
var obj = xlsx.parse(fs.readFileSync(__dirname + '/test.xlsx'));
console.log(JSON.stringify(obj));
Run Code Online (Sandbox Code Playgroud) 我正在尝试在 Ubuntu 上安装 node-libcurl 模块。要安装,我使用以下命令:
npm install node-libcurl --save
但我面临这个问题:
节点预gyp ERR!尝试下载(404):https : //github.com/JCMais/node-libcurl/releases/download/v1.1.0/node_libcurl-v1.1.0-node-v57-linux-x64.tar.gz
节点预gyp ERR!未找到 node-libcurl@1.1.0 和 node@8.0.0 (node-v57 ABI) 的预构建二进制文件(使用 node-gyp 回退到源代码编译)
吉普错误!配置错误
吉普错误!堆栈错误:
gyp失败,退出代码:1吉普错误!堆栈在 ChildProcess.onCpExit (/home/myfolder/node_modules/node-gyp/lib/configure.js:308:16)
吉普错误!堆栈在emitTwo (events.js:125:13)
吉普错误!ChildProcess.emit 上的堆栈 (events.js:213:7)
吉普错误!堆栈在 Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
吉普错误!系统 Linux 4.2.0-42-generic
吉普错误!命令 "/usr/local/bin/node" "/home/myfolder/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home /myfolder/node_modules/node-libcurl/lib/binding/node_libcurl.node" "--module_name=node_libcurl" "--module_path=/home/myfolder/node_modules/node-libcurl/lib/binding"
吉普错误!cwd /home/myfolder/node_modules/node-libcurl
吉普错误!节点 -v v8.0.0
吉普错误!节点-gyp -v v3.5.0
吉普错误!不好
节点预gyp ERR!构建错误
节点预gyp ERR!堆栈在emitTwo (events.js:125:13)
节点预gyp ERR!ChildProcess.emit 上的堆栈 (events.js:213:7)
节点预gyp ERR!堆栈在可能关闭(内部/child_process.js:887:16)
节点预gyp ERR!堆栈在 Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
节点预gyp ERR!系统 Linux 4.2.0-42-generic …
我正在努力处理Typescript并修改现有模块的定义。
我们习惯将要输出的任何内容都放入“ res.out”,最后有类似“ res.json(res.out)”的内容。这使我们能够在发送响应时对应用程序进行一般控制。
所以我有这样的功能
export async function register(req: Request, res: Response, next: Next) {
try {
const user = await userService.registerOrdinaryUser(req.body)
res.status(201);
res.out = user;
return helper.resSend(req, res, next);
} catch (ex) {
return helper.resError(ex, req, res, next);
}
};
Run Code Online (Sandbox Code Playgroud)
我们正在使用restify。而且我收到编译错误,因为“输出”不是restify.Response的一部分。
现在,我们有了解决方法,即拥有“自己的”对象,该对象扩展了Restify对象。
import {
Server as iServer,
Request as iRequest,
Response as iResponse,
} from 'restify'
export interface Server extends iServer {
}
export interface Request extends iRequest {
}
export interface Response extends iResponse {
out?: any;
} …Run Code Online (Sandbox Code Playgroud) 我正在使用电子打包器来创建我的应用程序的electron.exe.我需要排除所有节点模块.我尝试了以下内容
--ignore = node_modules
以上不起作用.知道如何在最终版本中排除所有文件夹/删除节点模块.
我得到一个像这样以毫秒为单位的日期
1525520235000
我想将其转换为当地时间
2018 年 5 月 5 日星期六 17:22:15
如何在 NodeJS 中完成此操作?谢谢。
在 Webpack 4 中,
我想把我的rsg-components而不是一个放在node_modules.
所以react-styleguidist将导入我的版本。
显然resolve.alias不优先node_modules,有没有办法在不分叉的情况下这样做react-stylguidist?
运行 node.js 服务器,我想在我的 javascript 代码中显示 nodejs 版本及其所有模块和版本。类似
console.log(MODULENAME.version), .. 不知道怎么做和它的语法。任何帮助表示赞赏
When I update the project Files I get this issue given Below:
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::4000
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at Server.listen (net.js:1476:7)
at Function.listen (E:\nodejs-mysql-authentication- master\node_modules\express\lib\application.js:618:24)
at Object.<anonymous> (E:\nodejs-mysql-authentication-master\server.js:26:5)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
[nodemon] app crashed - waiting for file changes before starting...
Run Code Online (Sandbox Code Playgroud)
I already try all this point to short out this issue given below …
我正在使用运行“ node_modules/.bin/webpack ”,但我知道可以配置路径,以便您只需键入“ webpack ”。不过,我找不到方法。:/
node-modules ×10
node.js ×7
javascript ×5
npm ×2
webpack ×2
asar ×1
date ×1
electron ×1
firebase ×1
node-gyp ×1
node-libcurl ×1
nodemon ×1
npm-install ×1
reactjs ×1
typescript ×1
vue-loader ×1
vue.js ×1