开发人员最近使用最新的node.js对我们的应用程序进行了一些更改。我可以通过localhost:port访问它,但是不再通过url访问。我得到的错误是:
应用程序引发了未捕获的异常并被终止: E:\ inetpub \ app \ server.js:3 从“路径”导入路径;
'path'似乎不如'import'重要,下面是最新server.js的第一行,下面是前一行的行。似乎支持var,但不导入iisnode
-NEW server.js
import path from 'path';
import express from 'express';
import webpack from 'webpack';
import webpackMiddleware from 'webpack-dev-middleware';
import webpackHotMiddleware from 'webpack-hot-middleware';
import config from './webpack.config.js';
import http from 'http';
import fs from 'fs';
import FileStreamRotator from 'file-stream-rotator';
import session from 'express-session';
import morgan from 'morgan';
import cookieParser from 'cookie-parser';
import bodyParser from 'body-parser';
import favicon from 'serve-favicon';
const isDeveloping = process.env.NODE_ENV !== 'production';
const port = isDeveloping ? 3000 : process.env.NODE_ENV;
const app = express();
-OLD Server.js
var path = require('path');
var express = require('express');
var http = require('http');
var fs = require('fs');
var FileStreamRotator = require('file-stream-rotator');
var session = require('express-session');
var morgan = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var favicon = require('serve-favicon');
var isDeveloping = process.env.NODE_ENV !== 'production';
var port = isDeveloping ? 3000 : process.env.PORT;
var app = express();