运行本地服务器

时间:2016-08-10 01:51:31

标签: javascript reactjs

我尝试为React应用配置hjs-webpack,当我尝试启动本地服务器时,我一直收到以下错误。我正在跑步 $ NODE_ENV=development ./node_modules/.bin/hjs-dev-server
在命令行中。谁能告诉我我做错了什么?

{ Error: ENOENT: no such file or directory, open '.env'
    at Error (native)
    at Object.fs.openSync (fs.js:634:18)
    at Object.fs.readFileSync (fs.js:502:33)
    at Object.module.exports.config (/Users/willfang/Desktop/YelpCloneApp/node_modules/dotenv/lib/main.js:30:37)
    at Object.<anonymous> (/Users/willfang/Desktop/YelpCloneApp/webpack.config.js:39:27)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3) errno: -2, code: 'ENOENT', syscall: 'open', path: '.env' }
Listening at http://localhost:3000
webpack built 24441e14a13ab3b5b7a2 in 4874ms
Hash: 24441e14a13ab3b5b7a2
Version: webpack 1.13.1
Time: 4874ms
 Asset    Size  Chunks       Chunk Names
app.js  209 kB       0       main
chunk    {0} app.js (main) 73.5 kB [rendered]
    [0] multi main 40 bytes {0} [built] [1 error]
    [1] (webpack)-hot-middleware/client.js 4.49 kB {0} [built]
    [2] (webpack)/buildin/module.js 251 bytes {0} [built]
    [3] ./~/strip-ansi/index.js 161 bytes {0} [built]
    [4] ./~/ansi-regex/index.js 135 bytes {0} [built]
    [5] (webpack)-hot-middleware/client-overlay.js 1.74 kB {0} [built]
    [6] ./~/ansi-html/index.js 4.02 kB {0} [built]
    [7] ./~/html-entities/index.js 231 bytes {0} [built]
    [8] ./~/html-entities/lib/xml-entities.js 2.98 kB {0} [built]
    [9] ./~/html-entities/lib/html4-entities.js 6.57 kB {0} [built]
   [10] ./~/html-entities/lib/html5-entities.js 49 kB {0} [built]
   [11] (webpack)-hot-middleware/process-update.js 3.88 kB {0} [built]

ERROR in ./src/app.js
Module build failed: Error: Couldn't find preset "stage-0" relative to directory "/Users/willfang/Desktop/YelpCloneApp"
    at /Users/willfang/Desktop/YelpCloneApp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:321:17
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/willfang/Desktop/YelpCloneApp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:305:20)
    at OptionManager.mergePresets (/Users/willfang/Desktop/YelpCloneApp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:288:10)
    at OptionManager.mergeOptions (/Users/willfang/Desktop/YelpCloneApp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:14)
    at OptionManager.init (/Users/willfang/Desktop/YelpCloneApp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:383:12)
    at File.initOptions (/Users/willfang/Desktop/YelpCloneApp/node_modules/babel-core/lib/transformation/file/index.js:223:65)
    at new File (/Users/willfang/Desktop/YelpCloneApp/node_modules/babel-core/lib/transformation/file/index.js:140:24)
    at Pipeline.transform (/Users/willfang/Desktop/YelpCloneApp/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at transpile (/Users/willfang/Desktop/YelpCloneApp/node_modules/babel-loader/index.js:14:22)
 @ multi main

0 个答案:

没有答案