Angular 2 App上的Socket.io 404错误

时间:2016-12-06 23:46:34

标签: javascript angular typescript socket.io

我正在构建一个Angular 2应用程序,到目前为止,大多数事情已按计划进行。但是,今天当我启动我的应用程序时,我在浏览器控制台中收到一条错误消息:

Error: Error: XHR error (404 Not Found) loading http://localhost:3000/node_modules//socket.io-client/socket.io.js(…)

对我来说奇怪的是,我几天前推出的应用程序版本没有任何问题,应用程序的任何相关部分都没有任何不同。那么......在哪里寻找解决这个问题的方法?另外,为了澄清,当我键入“npm start”时终端没有出现错误,而是我只是在浏览器中挂起“正在加载...”文本,当我看到控制台时,就是当我看到错误时我把它包含在上面。

这是我的package.json文件:

{
  "name": "abc",
  "version": "0.0.1",
  "scripts": {
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
    "lite": "lite-server",
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings",
    "docs": "typedoc --experimentalDecorators --out docs/ app/ --target 'es5' -module 'system' --ignoreCompilerErrors",
    "clean": "del /q dist",
    "browserify": "^13.0.1",
    "uglifyjs": "^2.4.10",
    "minify": "uglifyjs dist/main.min.js --screw-ie8 --compress --mangle --output dist/main.min.js",
    "build": "npm run clean && tsc",
    "build_prod": "npm run build && browserify -s main dist/main.js > dist/main.min.js && npm run minify"
  },
  "license": "ISC",
  "dependencies": {
    "@angular/common": "^2.0.0",
    "@angular/compiler": "^2.0.0",
    "@angular/core": "^2.0.0",
    "@angular/forms": "^2.0.0",
    "@angular/http": "^2.0.0",
    "@angular/material": "^2.0.0-alpha.10",
    "@angular/platform-browser": "^2.0.0",
    "@angular/platform-browser-dynamic": "^2.0.0",
    "@angular/router": "^3.0.0",
    "@angular2-material/button": "^2.0.0-alpha.8-2",
    "@angular2-material/core": "^2.0.0-alpha.8-2",
    "@angular2-material/input": "^2.0.0-alpha.8-2",
    "angular-in-memory-web-api": "~0.1.15",
    "bootstrap": "^3.3.6",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.12",
    "socket.io-client": "^1.4.8",
    "systemjs": "0.19.27",
    "typings": "^1.5.0",
    "zone.js": "^0.6.23"
  },
  "devDependencies": {
    "@types/hammerjs": "^2.0.32",
    "browserify": "^13.0.1",
    "concurrently": "^2.2.0",
    "jasmine-core": "^2.5.2",
    "karma": "^1.3.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-jasmine": "^1.0.2",
    "lite-server": "^2.2.2",
    "typescript": "^2.0.2",
    "typings": "^1.5.0",
    "uglifyjs": "^2.4.10"
  }
}

0 个答案:

没有答案