开发者社区> 问答> 正文

引入ali-oss js-sdk后,项目启动报错

如题,当我在项目页面引入ali-oss 后,项目启动报错,不引入则一切正常。
image

//错误信息:
image

以下是一些项目基本信息:
1)package.json
...
"devDependencies": {

"asar": "^0.13.0",
"babel-core": "^6.25.0",
"babel-loader": "^7.0.0",
"babel-polyfill": "^6.23.0",
"babel-preset-env": "^1.5.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-latest": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babel-preset-stage-3": "^6.24.1",
"css-emitter": "0.0.1",
"css-loader": "^0.23.1",
"ejs": "^2.5.2",
"ejs-loader": "^0.3.0",
"electron": "^1.6.11",
"electron-builder": "^19.12.0",
"electron-connect": "^0.6.1",
"electron-package": "^0.1.0",
"electron-packager": "^8.7.2",
"electron-prebuilt": "^1.4.13",
"emitter": "0.0.5",
"eslint": "^4.0.0",
"eslint-config-standard": "^10.2.1",
"eslint-loader": "^1.8.0",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-node": "^5.0.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"event": "^1.0.0",
"file-loader": "^0.9.0",
"gulp": "^3.9.1",
"highcharts": "^5.0.14",
"html-webpack-plugin": "^2.28.0",
"json-loader": "^0.5.4",
"less": "^2.7.1",
"less-loader": "^2.2.3",
"loader-utils": "^0.2.16",
"lodash": "^4.17.4",
"lodash.compact": "^3.0.1",
"parallelshell": "^3.0.1",
"source-map-loader": "^0.2.1",
"style-loader": "^0.13.1",
"transfer-webpack-plugin": "^0.1.4",
"uglifyjs-webpack-plugin": "^0.4.6",
"url-loader": "^0.5.7",
"webpack": "^2.6.1"

},
"dependencies": {

"axios": "^0.16.2",
"ali-oss": "^4.11.0",
"calendar": "^0.1.0",
"electron-json-storage": "^3.0.5",
"jsonsql": "^0.2.5",
"keyboardjs": "^2.3.3",
"lodash.clonedeep": "^4.5.0",
"lodash.compact": "^3.0.1",
"lodash.difference": "^4.5.0",
"lodash.findindex": "^4.6.0",
"lodash.isequal": "^4.5.0",
"lodash.pullat": "^4.6.0",
"lodash.remove": "^4.7.0",
"lodash.sortby": "^4.7.0",
"lodash.sortbyorder": "^3.4.4",
"md5": "^2.2.1",
"melanke-watchjs": "^1.3.1",
"moment": "^2.18.1",
"move-js": "^0.5.0",
"nedb": "^1.8.0",
"qrcode-npm": "0.0.3",
"socket.io-client": "^2.0.3"

}
...

2)babel设置
{

"presets": [
    "es2015",
    "stage-0",
    "stage-3"
]

}
3)eslint设置
{

"extends": "standard",
"plugins": [
    "standard",
    "promise"
],
"rules": {
    "indent": ["error", 4]
}

}
4) node 版本:8.6.0
5) npm版本 5.3.0

问题:

1.项目的node_modules文件夹中已经存在了proxy-agent模块,为何webpack编译时没编译进去,显示webpackMissingModule

2.是否是eslint的缘故,导致new !(function webpackMissingModule() 这种写法会报错,而去掉!后就一切正常了。可否在不改变设置的情况下解决此问题?

展开
收起
tianjian_sky 2017-10-27 18:50:52 4240 0
1 条回答
写回答
取消 提交回答
  • 这个应该是语法报错了吧,不应该是new !(function xxx),试一下! new function()xxx

    2019-07-17 21:41:21
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
JavaScript面向对象的程序设计 立即下载
Delivering Javascript to World 立即下载
编程语言如何演化-以JS的private为例 立即下载