chenqy930's recent timeline updates
chenqy930

chenqy930

V2EX member #314231, joined on 2018-05-04 17:02:32 +08:00
  •   The specified image does not exist
    chenqy930's recent replies
    May 18, 2018
    Replied to a topic by chenqy930 › Node.js › 用 console.log()在控制台看不到输出
    @YenvY 试过了 不行><
    May 18, 2018
    Replied to a topic by chenqy930 › Node.js › 用 console.log()在控制台看不到输出
    @Yokira 怎么看 webpack 是编译前端还是后端呀.. 我就是用的 npm start...

    另外好像找不到项目用来输出其他调试信息的代码,用到 winston 模块的只在这一段,
    app.use((err, req, res, next) => {
    logger.warn('%s', err.stack);
    res.status(err.status || 500).json({
    message: err.message,
    error: config.env === 'development' ? err.stack : {}
    });
    });

    输出的信息类似于:
    2018-05-18T09:39:12.701Z [INFO] GET /view.html 304 0.330 ms - -
    2018-05-18T09:39:12.709Z [INFO] GET /styles/view.bundle.css 304 0.638 ms - -
    2018-05-18T09:39:12.709Z [INFO] GET /styles/layout.bundle.css 304 0.913 ms - -
    2018-05-18T09:39:12.710Z [INFO] GET /scripts/view.bundle.js 304 1.225 ms - -
    May 18, 2018
    Replied to a topic by chenqy930 › Node.js › 用 console.log()在控制台看不到输出
    @will0404
    1、package.json 中没有看到 babel 模块,所以应该没有用到 babel。
    2、运行前确实有个一分钟左右的编译过程,webpack 配置的话有一个文件是 webpack.common.js ,里面的模块有 entry、output、resolve、module、plugins 和 node,哪块会是跟 console 被去掉有关的呢?
    May 18, 2018
    Replied to a topic by chenqy930 › Node.js › 用 console.log()在控制台看不到输出
    @dr490n
    "scripts": {
    "build:dev": "npm run clean && npm run preprocess && npm run webpack -- --watch",
    "build": "npm run clean && npm run preprocess && npm run webpack",
    "clean:dist": "npm run rimraf -- dist",
    "clean": "npm cache clean && npm run clean:dist",
    "lint": "eslint src/**/*.js",
    "node": "node",
    "preprocess": "node config/preprocess.js",
    "rimraf": "rimraf",
    "server": "node server/index.js",
    "start": "npm run build && npm run server",
    "test": "echo \"Error: no test specified\" && exit 1",
    "webpack": "webpack --config webpack.config.js --progress --profile",
    "yarn": "yarn --ignore-engines"
    },


    刚注意看了一下输出,
    2018-05-18T00:47:17.942Z [INFO] config: {"env":"production","logLevel":"silly","serverPort":8080}
    2018-05-18T00:47:17.950Z [INFO] Webportal server starts on port 8080
    2018-05-18T00:47:42.867Z [WARN] Error: Page not found

    确实是在 production, 然后我在配置文件中改成了 development, 还是没有输出><
    2018-05-18T02:14:09.554Z [INFO] config: {"env":"development","logLevel":"silly","serverPort":8080}
    May 18, 2018
    Replied to a topic by chenqy930 › Node.js › 用 console.log()在控制台看不到输出
    @wukaichao 应该不会
    May 18, 2018
    Replied to a topic by chenqy930 › Node.js › 用 console.log()在控制台看不到输出
    @miketeam 想在后台看输出的,应该跟 html 没有关系吧?
    May 18, 2018
    Replied to a topic by chenqy930 › Node.js › 用 console.log()在控制台看不到输出
    @noe132 噢还有这个可能,那这该怎么办呢?
    May 7, 2018
    Replied to a topic by chenqy930 › NGINX › ngnix 做代理的问题
    有道理啊,可是 B 也不便修改呢- -
    May 7, 2018
    Replied to a topic by chenqy930 › NGINX › ngnix 做代理的问题
    因为服务器 A 的代码不便修改,所以还是想尽量用代理实现,我去看看 lua,感谢~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1448 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 17ms · UTC 16:32 · PVG 00:32 · LAX 09:32 · JFK 12:32
    ♥ Do have faith in what you're doing.