NPM启动开发服务器问题

时间:2019-02-17 23:44:52

标签: javascript node.js reactjs npm webpack

我无法启动我的React开发人员,并且我有不同的解决方法,包括删除webpack和webpack-dev-server,但没有任何更改。请帮我。在终端上找到以下初始错误。

react-scripts start

module.js:549
    throw err;
    ^

Error: Cannot find module 'webpack'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\URLIVE STREAM\Documents\Goals\Mobile apps\Fresh\Web\node_modules\webpack-dev-server\lib\Server.js:22:17)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fresh-app@1.5.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fresh-app@1.5.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\URLIVE STREAM\AppData\Roaming\npm-cache\_logs\2019-02-17T23_31_31_683Z-debug.log

请在我的package.json文件下面找到

{
  "name": "",
  "version": "1.5.0",
  "description": "",
  "private": false,
  "main": "dist/index.js",
  "dependencies": {
    "@material-ui/core": "3.1.0",
    "@material-ui/icons": "3.0.1",
    "@types/googlemaps": "3.30.13",
    "@types/markerclustererplus": "2.1.33",
    "ajv": "^5.0.0",
    "body-parser": "^1.18.3",
    "chartist": "0.10.1",
    "classnames": "2.2.6",
    "express": "^4.16.4",
    "helmet": "^3.15.0",
    "mongodb": "^3.1.10",
    "mongoose": "^5.3.12",
    "npm-run-all": "4.1.3",
    "perfect-scrollbar": "1.4.0",
    "react": "16.5.2",
    "react-chartist": "0.13.1",
    "react-dom": "16.5.2",
    "react-google-maps": "9.4.5",
    "react-redux": "^6.0.0",
    "react-router-dom": "4.3.1",
    "react-scripts": "1.1.5",
    "react-swipeable-views": "0.12.17",
    "react-thunk": "^1.0.0",
    "redux": "^4.0.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "wdio",
    "eject": "react-scripts eject",
    "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
    "lint:check": "eslint . --ext=js,jsx;  exit 0",
    "lint:fix": "eslint . --ext=js,jsx --fix;  exit 0",
    "build-package": "babel src --out-dir dist",
    "e2e": "npm test -- wdio.conf.dev.js "
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "keywords": [],
  "author": "A",
  "license": "",
  "bugs": {
    "url": ""
  },
  "homepage": "",
  "optionalDependencies": {
    "babel-eslint": "7.2.3",
    "eslint": "4.19.1",
    "eslint-config-prettier": "3.0.1",
    "eslint-plugin-prettier": "2.6.2",
    "eslint-plugin-react": "7.11.1",
    "prettier": "1.14.3"
  },
  "devDependencies": {
    "babel-cli": "6.26.0",
    "babel-plugin-module-resolver": "3.1.1",
    "babel-plugin-import-rename": "1.0.1",
    "babel-plugin-transform-object-rest-spread": "6.26.0",
    "babel-plugin-transform-react-jsx": "6.24.1",
    "babel-preset-es2015": "6.24.1",
    "nodemon": "^1.18.10"
  }
}

您还可以在问题的错误日志下方找到。

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@5.6.0
3 info using node@v8.11.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle freshacres-foundation-app@1.5.0~prestart: freshacres-foundation-app@1.5.0
6 info lifecycle freshacres-foundation-app@1.5.0~start: freshacres-foundation-app@1.5.0
7 verbose lifecycle freshacres-foundation-app@1.5.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle freshacres-foundation-app@1.5.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\URLIVE STREAM\Documents\Goals\Mobile apps\Freshacres\Web\node_modules\.bin;C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\bin\Intel64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\MongoDB\Server\4.0\bin;C:\Users\URLIVE STREAM\AppData\Local\Microsoft\WindowsApps;C:\Users\URLIVE STREAM\AppData\Roaming\npm;C:\Users\URLIVE STREAM\AppData\Local\Programs\Microsoft VS Code\bin
9 verbose lifecycle fresh-app@1.5.0~start: CWD: C:\Users\URLIVE STREAM\Documents\Goals\Mobile apps\Fresh\Web
10 silly lifecycle fresh-app@1.5.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle fresh-app@1.5.0~start: Returned: code: 1  signal: null
12 info lifecycle fresh-app@1.5.0~start: Failed to exec start script
13 verbose stack Error: fresh-app@1.5.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid fresh-app@1.5.0
15 verbose cwd C:\Users\URLIVE STREAM\Documents\Goals\Mobile apps\Fresh\Web
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v8.11.4
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error fresh-app@1.5.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the fresh-app@1.5.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

如果有人能帮助我,我将非常感激。

0 个答案:

没有答案