更新到最新版本的 aurelia 后,该项目没有 运行 我得到:"cannot find module './aurelia-framework'" 来自 webpack

After updating to the latest version of aurelia, the project doesn't run and I am getting: "cannot find module './aurelia-framework'" from webpack

我正在使用大约两个月前的 aurelia webpack/es2016 导航骨架版本。一切正常,但今天我删除了我的 node_modules 目录并做了一个新的 npm install 并且我的前端不再是 运行,并且在控制台中我得到了我上面提到的错误:cannot find module './aurelia-framework'

这是我的 package.json 以防上下文有帮助:

{
  "name": "my-project-name",
  "version": "4.0.0",
  "sasslintConfig": "./.sass-lint.yml",
  "description": "Aurelia Front End Web App",
  "main": "index.js",
  "scripts": {
    "dev": "webpack-dev-server -d --config webpack.config.js --hot --inline --progress --devtool source-map --host 0.0.0.0",
    "a": "webpack-dev-server -d --config webpack.andrew.config.js --hot --inline --progress --devtool source-map",
    "build": "webpack --config webpack.config.js --progress --profile",
    "prod": "webpack -p --config webpack.prod.config.js --progress",
    "test": "karma start",
    "webdriver:update": "./node_modules/.bin/webdriver-manager update",
    "webdriver:start": "./node_modules/.bin/webdriver-manager start",
    "pree2e": "npm run webdriver:update -- --standalone",
    "e2e": "./node_modules/.bin/protractor",
    "eslint": "eslint -c .eslintrc.json src"
  },
  "dependencies": {
    "aurelia-bootstrapper-webpack": "^1.0.0-beta.1.0.0",
    "aurelia-event-aggregator": "^1.0.0-beta.1.2.0",
    "aurelia-fetch-client": "^1.0.0-beta.1.2.5",
    "aurelia-framework": "^1.0.0-beta.1.2.5",
    "aurelia-history-browser": "^1.0.0-beta.1.1.2",
    "aurelia-i18n": "^0.5.3",
    "aurelia-logging-console": "^1.0.0-beta.1.1.4",
    "aurelia-notification": "^1.0.0-rc1",
    "aurelia-pal-browser": "^1.0.0-beta.1.1.4",
    "aurelia-polyfills": "^1.0.0-beta.1.0.0",
    "aurelia-router": "^1.0.0-beta.1.1.1",
    "aurelia-templating-binding": "^1.0.0-beta.1.1.1",
    "aurelia-templating-resources": "^1.0.0-beta.1.1.1",
    "aurelia-templating-router": "^1.0.0-beta.1.1.1",
    "babel-polyfill": "^6.9.0",
    "bluebird": "^3.3.4",
    "bootstrap": "^4.0.0-alpha.2",
    "exports-loader": "^0.6.3",
    "font-awesome": "^4.5.0",
    "humane-js": "^3.2.2",
    "imports-loader": "^0.6.5",
    "isomorphic-fetch": "^2.2.1",
    "jquery": "^2.2.3",
    "json-loader": "^0.5.4",
    "node-sass": "^3.6.0",
    "oidc-client": "^1.0.0",
    "rome": "^2.1.22",
    "sass-loader": "^3.2.0",
    "tether": "^1.3.2",
    "tether-drop": "^1.4.2",
    "timezones.json": "^1.1.0",
    "whatwg-fetch": "^1.0.0"
  },
  "devDependencies": {
    "aurelia-tools": "^0.1.18",
    "aurelia-webpack-plugin": "^1.0.0-beta.1.0.0",
    "autoprefixer": "^6.3.6",
    "babel-core": "^6.7.2",
    "babel-eslint": "^6.0.4",
    "babel-loader": "^6.2.4",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-plugin-transform-regenerator": "^6.9.0",
    "babel-preset-es2015": "^6.6.0",
    "babel-preset-es2015-loose": "^7.0.0",
    "babel-preset-stage-0": "^6.5.0",
    "browser-sync": "^2.12.5",
    "browser-sync-webpack-plugin": "^1.0.1",
    "css-loader": "^0.23.1",
    "eonasdan-bootstrap-datetimepicker": "^4.15.35",
    "eslint": "^2.9.0",
    "eslint-config-airbnb": "^8.0.0",
    "eslint-loader": "^1.3.0",
    "eslint-plugin-import": "^1.6.1",
    "eslint-plugin-jsx-a11y": "^1.0.4",
    "eslint-plugin-react": "^5.0.1",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.8.5",
    "html-loader": "^0.4.3",
    "html-webpack-plugin": "^2.9.0",
    "istanbul": "^0.4.3",
    "istanbul-instrumenter-loader": "^0.2.0",
    "jasmine-core": "^2.4.1",
    "karma": "^0.13.21",
    "karma-babel-preprocessor": "^6.0.1",
    "karma-chrome-launcher": "^0.2.2",
    "karma-coverage": "^0.5.5",
    "karma-jasmine": "^0.3.7",
    "karma-webpack": "^1.7.0",
    "node-sass": "^3.4.2",
    "postcss-loader": "^0.9.1",
    "precss": "^1.4.0",
    "protractor": "^3.2.1",
    "raw-loader": "^0.5.1",
    "sass-lint": "^1.7.0",
    "sass-loader": "^3.2.0",
    "style-loader": "^0.13.0",
    "url-loader": "^0.5.7",
    "wallaby-webpack": "0.0.21",
    "webpack": "^1.13.0",
    "webpack-dev-server": "^1.14.1"
  }
}

我相信最新的 aurelia-webpack-plugin 有问题。作为临时解决方案,降级 aurelia-webpack-plugin 版本。为此,在您的 package.json 中,将 aurelia-webpack-plugin 行更改为:

"aurelia-webpack-plugin": "1.0.0-beta.1.0.4"

运行 npm install

您可以在此处找到有关此问题的更多详细信息https://github.com/aurelia/webpack-plugin/issues/30