簡體   English   中英

React Js Project未運行Webpack本地服務器

[英]React Js Project not running Webpack local server

我剛剛關閉了我的本地react應用程序,並試圖將其重新啟動,並且一直說它在我的腳本start:dev上失敗了,任何人都可以幫助我調試日志的大量散布,但它不確定錯誤出在哪里。

這是我的package.json

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "webpack.config.js",
  "dependencies": {
  "babel-core": "^6.17.0",
  "babel-loader": "^6.2.0",
  "babel-plugin-add-module-exports": "^0.1.2",
  "babel-plugin-react-html-attrs": "^2.0.0",
  "babel-plugin-transform-class-properties": "^6.3.13",
  "babel-plugin-transform-decorators-legacy": "^1.3.4",
  "babel-preset-es2015": "^6.3.13",
  "babel-preset-react": "^6.3.13",
  "babel-preset-stage-0": "^6.3.13",
  "history": "^1.17.0",
  "json-loader": "^0.5.4",
  "nouislider": "^10.0.0",
  "prop-types": "^15.5.10",
  "react": "^0.14.6",
  "react-dom": "^0.14.6",
  "react-html5-slider": "^0.2.1",
  "react-input-range": "^1.1.4",
  "react-modal-bootstrap": "^1.1.1",
  "react-nbsp": "^1.1.0",
  "react-rangeslider": "^2.1.0",
  "react-rangeslider-extended": "^1.0.10",
  "react-router": "^1.0.3",
  "react-router-redux": "^4.0.8",
  "webpack": "^1.12.9",
  "webpack-dev-server": "^1.14.1"
},
"devDependencies": {
  "css-loader": "^0.25.0",
  "ignore-loader": "^0.1.2",
  "ignore-styles": "^5.0.1",
  "reactjs-css-load": "^1.0.0"
},
"scripts": {
  "start": "npm run start:dev",
  "start:dev": "webpack-dev-server --content-base src --history-api-fallback"
},
"author": "",
"license": "ISC"

}

這是我得到的錯誤

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using npm@3.10.10
3 info using node@v6.11.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle test@1.0.0~prestart: test@1.0.0
6 silly lifecycle test@1.0.0~prestart: no script for prestart, continuing
7 info lifecycle test@1.0.0~start: test@1.0.0
8 verbose lifecycle test@1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle test@1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\wilsona.CHECKMATE\Desktop\reactapp\Workspace\bootstrap\app\node_modules\.bin;C:\Users\wilsona.CHECKMATE\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\IBM\SPSS\Statistics\24\JRE\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\nodejs\;C:\Users\wilsona.CHECKMATE\AppData\Local\atom\bin;C:\Users\wilsona.CHECKMATE\AppData\Roaming\npm
10 verbose lifecycle test@1.0.0~start: CWD: C:\Users\wilsona.CHECKMATE\Desktop\reactapp\Workspace\bootstrap\app
11 silly lifecycle test@1.0.0~start: Args: [ '/d /s /c', 'npm run start:dev' ]
12 silly lifecycle test@1.0.0~start: Returned: code: 1  signal: null
13 info lifecycle test@1.0.0~start: Failed to exec start script
14 verbose stack Error: test@1.0.0 start: `npm run start:dev`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:891:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid test@1.0.0
16 verbose cwd         C:\Users\wilsona.CHECKMATE\Desktop\reactapp\Workspace\bootstrap\app
17 error Windows_NT 6.1.7601
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 error node v6.11.0
20 error npm  v3.10.10
21 error code ELIFECYCLE
22 error test@1.0.0 start: `npm run start:dev`
22 error Exit status 1
23 error Failed at the test@1.0.0 start script 'npm run start:dev'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the test package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     npm run start:dev
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs test
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls test
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

請幫忙

var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
var path = require('path');

module.exports = {
  context: path.join(__dirname, "src"),
  devtool: debug ? "inline-sourcemap" : null,
  entry: "./js/client.js",
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        exclude: /(node_modules|bower_components)/,
        loader: 'babel-loader', 'ignore-loader',
        query: {
          presets: ['react', 'es2015', 'stage-0'],
          plugins: ['react-html-attrs', 'transform-class-properties', 'transform-decorators-legacy', ]
        }
      }
    ]
  },
  output: {
    path: __dirname + "/src/",
   filename: "client.min.js"
  },
  plugins: debug ? [] : [
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
  ],
};

這是所請求的錯誤

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using npm@3.10.10
3 info using node@v6.11.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle test@1.0.0~prestart: test@1.0.0
6 silly lifecycle test@1.0.0~prestart: no script for prestart, continuing
7 info lifecycle test@1.0.0~start: test@1.0.0
8 verbose lifecycle test@1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle test@1.0.0~start: PATH: C:\Program     Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\wilsona.CHECKMATE\Desktop\reactapp\Workspace\bootstrap\app\node_modules\.bin;C:\Users\wilsona.CHECKMATE\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\IBM\SPSS\Statistics\24\JRE\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\nodejs\;C:\Users\wilsona.CHECKMATE\AppData\Local\atom\bin;C:\Users\wilsona.CHECKMATE\AppData\Roaming\npm
10 verbose lifecycle test@1.0.0~start: CWD: C:\Users\wilsona.CHECKMATE\Desktop\reactapp\Workspace\bootstrap\app
11 silly lifecycle test@1.0.0~start: Args: [ '/d /s /c',
11 silly lifecycle   'webpack-dev-server --content-base src --history-api-fallback' ]
12 silly lifecycle test@1.0.0~start: Returned: code: 1  signal: null
13 info lifecycle test@1.0.0~start: Failed to exec start script
14 verbose stack Error: test@1.0.0 start: `webpack-dev-server --content-base src --history-api-fallback`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:891:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid test@1.0.0
16 verbose cwd C:\Users\wilsona.CHECKMATE\Desktop\reactapp\Workspace\bootstrap\app
17 error Windows_NT 6.1.7601
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 error node v6.11.0
20 error npm  v3.10.10
21 error code ELIFECYCLE
22 error test@1.0.0 start: `webpack-dev-server --content-base src --history-api-fallback`
22 error Exit status 1
23 error Failed at the test@1.0.0 start script 'webpack-dev-server --content-base src --history-api-fallback'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the test package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     webpack-dev-server --content-base src --history-api-fallback
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs test
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls test
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

我似乎已經解決了以下問題:我更新了節點和npm,然后刪除了所有的node_modules並再次安裝了npm,然后將[]放在“ babel-loader”周圍,然后刪除了“ ignore-loader”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM