本文介绍了[at-loader] node_modules@typesjasmine 中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 webpack 构建开始突然失败,没有更新包.我假设一些次要版本更新导致了这种情况,但无法弄清楚如何解决它.有谁知道该怎么做?

My webpack build started failing out of nowhere with no packages being updated. I assume some minor version update caused this, but can't figure out how to get around it. Does anyone know what to do?

ERROR in [at-loader] [email protected]:39:52
    TS1005: '=' expected.
ERROR in [at-loader] [email protected]:39:38
    TS2371: A parameter initializer is only allowed in a function or constructor implementation.
ERROR in [at-loader] [email protected]:39:46
    TS2304: Cannot find name 'keyof'.

package.json

package.json

  "dependencies": {
    "@angular/common": "2.4.7",
    "@angular/compiler": "~2.4.4",
    "@angular/core": "2.4.7",
    "@angular/forms": "2.4.7",
    "@angular/http": "~2.4.4",
    "@angular/material": "^2.0.0-beta.1",
    "@angular/platform-browser": "~2.4.4",
    "@angular/platform-browser-dynamic": "~2.4.4",
    "@angular/platform-server": "~2.4.4",
    "@angular/router": "~3.4.1",
    "@angularclass/conventions-loader": "^1.0.2",
    "@angularclass/hmr": "~1.2.2",
    "@angularclass/hmr-loader": "~3.0.2",
    "@vaadin/angular2-polymer": "^1.0.0",
    "animate.css": "^3.5.2",
    "assets-webpack-plugin": "^3.4.0",
    "bootstrap-sass": "^3.3.7",
    "bootstrap-select": "^1.12.1",
    "bootstrap-tour": "^0.11.0",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "http-server": "^0.9.0",
    "icheck": "^1.0.2",
    "ie-shim": "^0.1.0",
    "jasmine-core": "^2.5.2",
    "metismenu": "2.0.2",
    "nestable": "^0.2.0",
    "ng2-modal": "0.0.24",
    "ng2-tag-input": "~0.8.4",
    "pace": "0.0.4",
    "pace-progress": "^1.0.2",
    "primeng": "^1.1.4",
    "reflect-metadata": "^0.1.9",
    "rxjs": "~5.1.0",
    "summernote": "^0.8.2",
    "zone.js": "0.7.4",
    "ag-grid": "~8.0.1",
    "ag-grid-enterprise": "~8.0.1",
    "ag-grid-ng2": "~8.0.0"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~2.4.1",
    "@types/hammerjs": "^2.0.33",
    "@types/jasmine": "^2.2.34",
    "@types/node": "^6.0.38",
    "@types/selenium-webdriver": "2.53.38",
    "@types/source-map": "^0.5.0",
    "@types/uglify-js": "^2.0.27",
    "@types/webpack": "^2.0.0",
    "angular-router-loader": "^0.4.0",
    "angular2-template-loader": "^0.6.0",
    "assets-webpack-plugin": "^3.4.0",
    "awesome-typescript-loader": "~3.0.4-rc.2",
    "codelyzer": "~2.0.0-beta.4",
    "copy-webpack-plugin": "^4.0.0",
    "css-loader": "^0.26.0",
    "exports-loader": "^0.6.3",
    "expose-loader": "^0.7.1",
    "extract-text-webpack-plugin": "^2.0.0-beta.4",
    "file-loader": "^0.9.0",
    "gh-pages": "^0.12.0",
    "html-webpack-plugin": "^2.21.0",
    "imports-loader": "^0.7.0",
    "istanbul-instrumenter-loader": "1.2.0",
    "jasmine-core": "^2.5.2",
    "json-loader": "^0.5.4",
    "karma": "^1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-coverage": "^1.1.1",
    "karma-jasmine": "^1.0.2",
    "karma-mocha-reporter": "^2.0.0",
    "karma-remap-coverage": "^0.1.4",
    "karma-sourcemap-loader": "^0.3.7",
    "karma-webpack": "1.8.1",
    "ngc-webpack": "^1.0.2",
    "node-sass": "^4.1.1",
    "npm-run-all": "^4.0.0",
    "parse5": "^3.0.1",
    "protractor": "^4.0.10",
    "raw-loader": "0.5.1",
    "rimraf": "~2.5.4",
    "sass-loader": "^4.1.1",
    "script-ext-html-webpack-plugin": "^1.3.2",
    "source-map-loader": "^0.1.5",
    "string-replace-loader": "1.0.5",
    "style-loader": "^0.13.1",
    "to-string-loader": "^1.1.4",
    "ts-helpers": "1.1.2",
    "ts-node": "^2.0.0",
    "tslint": "4.2.0",
    "tslint-loader": "^3.3.0",
    "typedoc": "^0.5.3",
    "typescript": "2.0.10",
    "url-loader": "^0.5.7",
    "v8-lazy-parse-webpack-plugin": "^0.3.0",
    "webpack": "2.2.1",
    "webpack-dev-middleware": "^1.10.0",
    "webpack-dev-server": "2.3.0",
    "webpack-dll-bundles-plugin": "^1.0.0-beta.5",
    "webpack-md5-hash": "^0.0.5",
    "webpack-merge": "~2.6.1"
  }

推荐答案

看起来您的 @types/jasmine 库已升级到最新版本,因为您有插入符号:

Looks like your @types/jasmine library was upgraded to the latest version since you have the caret symbol:

"@types/jasmine": "^2.2.34",

最新版本存在问题,正如 bug 所暗示的.所以现在尝试在你的 package.json 中将版本设置为 2.5.41 :

The latest version is having issues as this bug suggests. So try for now by setting the version to 2.5.41 in your package.json :

"devDependencies": {
  "@types/jasmine": "2.5.41"
}

也许您必须删除您的 node-modules 文件夹并运行 npm install 以进行全新安装.

Maybe you have to delete your node-modules folder and run npm install for a clean installation.

这篇关于[at-loader] node_modules@typesjasmine 中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 06:20