我正在使用基于webpack的ng2,它工作正常,直到我更新package.json。之后我有一些错误。 有人可以帮帮我吗,问题出在哪里?感谢您的帮助!
P.S。我的项目基于官方的ng2 webpack示例。
Cannot find module 'enhanced-resolve/lib/getInnerRequest'
@ multi polyfillserrors @ client?cd17:75sock.onmessage @ socket.js:37EventTarget.dispatchEvent @ eventtarget.js:51(anonymous function) @ main.js:274SockJS._transportMessage @ main.js:272EventEmitter.emit @ emitter.js:50WebSocketTransport.ws.onmessage @ websocket.js:35
Cannot find module 'enhanced-resolve/lib/getInnerRequest'
@ multi vendorerrors @ client?cd17:75sock.onmessage @ socket.js:37EventTarget.dispatchEvent @ eventtarget.js:51(anonymous function) @ main.js:274SockJS._transportMessage @ main.js:272EventEmitter.emit @ emitter.js:50WebSocketTransport.ws.onmessage @ websocket.js:35
Cannot find module 'enhanced-resolve/lib/getInnerRequest'
@ multi app
这是我目前的packge.json
{
"name": "test",
"version": "1.0.0",
"description": "Test Project",
"scripts": {
"start": "webpack-dev-server --inline --progress --colors --port 8080",
"deploy": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail",
"postinstall": "typings install",
"test": "karma start"
},
"license": "MIT",
"dependencies": {
"@angular/common": "2.2.3",
"@angular/compiler": "2.2.3",
"@angular/core": "2.2.3",
"@angular/forms": "2.2.3",
"@angular/http": "2.2.3",
"@angular/platform-browser": "2.2.3",
"@angular/platform-browser-dynamic": "2.2.3",
"@angular/router": "3.2.3",
"@types/lodash": "^4.14.37",
"core-js": "^2.4.1",
"jquery": "^3.1.1",
"ng2-redux": "^4.0.0-beta.0",
"rxjs": "5.0.0-rc.4",
"zone.js": "^0.7.2"
},
"devDependencies": {
"@types/jquery": "^2.0.34",
"angular2-router-loader": "^0.3.3",
"angular2-template-loader": "^0.6.0",
"awesome-typescript-loader": "^3.0.0-beta.3",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.26.0",
"css-sourcemaps-webpack-plugin": "^1.0.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"html-loader": "^0.4.3",
"html-webpack-plugin": "^2.15.0",
"jasmine-core": "^2.4.1",
"karma": "^1.2.0",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.8.0",
"node-sass": "^3.10.1",
"phantomjs-prebuilt": "^2.1.7",
"raw-loader": "^0.5.1",
"reflect-metadata": "^0.1.8",
"resolve-url-loader": "^1.6.0",
"rimraf": "^2.5.2",
"sass-loader": "^4.0.2",
"style-loader": "^0.13.1",
"ts-loader": "^1.2.2",
"typescript": "^2.0.2",
"typings": "^2.0.0",
"webpack": "^1.13.0",
"webpack-dev-server": "^1.14.1",
"webpack-glob": "^2.0.2",
"webpack-merge": "^0.18.0",
"webpack-spritesmith": "^0.3.0",
"webpack-svgstore-plugin": "^3.0.5"
}
}
我以前的package.json(工作)
{
"name": "test",
"version": "1.0.0",
"description": "Test Project",
"scripts": {
"start": "webpack-dev-server --inline --progress --colors --port 8080",
"deploy": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail",
"postinstall": "typings install",
"test": "karma start"
},
"license": "MIT",
"dependencies": {
"@angular/common": "2.1.2",
"@angular/compiler": "2.1.2",
"@angular/core": "2.1.2",
"@angular/forms": "2.1.2",
"@angular/http": "2.1.2",
"@angular/platform-browser": "2.1.2",
"@angular/platform-browser-dynamic": "2.1.2",
"@angular/router": "3.1.2",
"@types/lodash": "^4.14.37",
"core-js": "^2.4.1",
"jquery": "^3.1.1",
"ng2-redux": "^4.0.0-beta.0",
"rxjs": "5.0.0-rc.1",
"zone.js": "^0.6.23"
},
"devDependencies": {
"@types/jquery": "^2.0.34",
"angular2-router-loader": "^0.3.3",
"angular2-template-loader": "^0.6.0",
"awesome-typescript-loader": "^2.2.4",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.25.0",
"css-sourcemaps-webpack-plugin": "^1.0.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"html-loader": "^0.4.3",
"html-webpack-plugin": "^2.15.0",
"jasmine-core": "^2.4.1",
"karma": "^1.2.0",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.8.0",
"node-sass": "^3.10.1",
"phantomjs-prebuilt": "^2.1.7",
"raw-loader": "^0.5.1",
"reflect-metadata": "^0.1.8",
"resolve-url-loader": "^1.6.0",
"rimraf": "^2.5.2",
"sass-loader": "^4.0.2",
"style-loader": "^0.13.1",
"ts-loader": "^0.9.5",
"typescript": "^2.0.2",
"typings": "^1.3.2",
"webpack": "^1.13.0",
"webpack-dev-server": "^1.14.1",
"webpack-glob": "^2.0.2",
"webpack-merge": "^0.15.0",
"webpack-spritesmith": "^0.3.0",
"webpack-svgstore-plugin": "^3.0.5"
}
}
答案 0 :(得分:0)
问题出在webpack依赖项中。我手动安装了插件 增强 - 解决,现在正在运作。 我希望它有助于某人并节省一些神经