ERROR in ./node_modules/mime-types/index.js 15:14-37 Module not found: Error: Can't resolve '
时间: 2023-11-06 16:36:58 浏览: 66
./types/other' in 'D:\project\myproject\node_modules\mime-types'
解决方法是什么?
这是一个错误提示,告诉我们在 mime-types 包的 index.js 文件中,第 15 行到 37 行之间引用了一个找不到的模块,即 types/other。解决方法可以尝试将 mime-types 包重新安装,或者手动添加缺失的模块。具体操作方式可以参考官方文档或者搜索相关解决方案。
相关问题
Refused to execute script from 'http://localhost:8080/node_modules/pdfjs-dist/build/pdf.worker.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
这个错误通常是由于 MIME 类型不匹配导致的。在你的情况中,浏览器拒绝执行脚本 'http://localhost:8080/node_modules/pdfjs-dist/build/pdf.worker.js',因为它的 MIME 类型被识别为 'text/html' 而不是可执行的脚本。
要解决这个问题,你可以尝试以下几种方法:
1. 确保正确引入了 `pdf.worker.js` 文件:请检查你的 HTML 页面或 JavaScript 代码,确保正确引入了 `pdf.worker.js` 文件。确保文件路径正确,并且文件存在于指定的位置。
2. 设置正确的 MIME 类型:如果你是自己托管 `pdf.worker.js` 文件,确保服务器正确设置了文件的 MIME 类型。对于 JavaScript 文件,MIME 类型应该是 `application/javascript`。你可以在服务器配置或代码中设置 MIME 类型,具体方法取决于你使用的服务器技术。
3. 检查服务器设置:如果你是在本地开发环境中遇到这个问题,可能是服务器设置有问题。请确保服务器允许处理 JavaScript 文件,并正确配置了 MIME 类型。
4. 使用绝对路径或 CDN:尝试使用绝对路径或使用 CDN 引入 `pdf.worker.js` 文件。这样可以避免由于相对路径导致的错误。
如果以上方法仍然不能解决问题,请提供更多关于你的代码和服务器配置的信息,以便我们能够更具体地帮助你解决问题。
2 400 index.vue:399 QiniuRequestError {name: 'RequestError', message: 'xhr request failed, code: 400 response: {"error":"…field CompleteMultipart.mimeType of type string"}', stack: 'Error\n at QiniuRequestError.QiniuError (webpack…node_modules/qiniu-js/esm/utils/helper.js:248:24)', code: 400, reqId: 'Mm0AAACDvvroC2YX', …} code : 400 data : error : "json: cannot unmarshal array into Go struct field CompleteMultipart.mimeType of type string" [[Prototype]] : Object constructor : ƒ Object() hasOwnProperty : ƒ hasOwnProperty() isPrototypeOf : ƒ isPrototypeOf() propertyIsEnumerable : ƒ propertyIsEnumerable() toLocaleString : ƒ toLocaleString() toString : ƒ toString() valueOf : ƒ valueOf() __defineGetter__ : ƒ __defineGetter__() __defineSetter__ : ƒ __defineSetter__() __lookupGetter__ : ƒ __lookupGetter__() __lookupSetter__ : ƒ __lookupSetter__() __proto__ : (...) get __proto__ : ƒ __proto__() set __proto__ : ƒ __proto__() isRequestError : true message : "xhr request failed, code: 400 response: {\"error\":\"json: cannot unmarshal array into Go struct field CompleteMultipart.mimeType of type string\"}" name : "RequestError" reqId : "Mm0AAACDvvroC2YX" stack : "Error\n at QiniuRequestError.QiniuError (webpack-internal:///./node_modules/qiniu-js/esm/errors/index.js:47:22)\n at new QiniuRequestError (webpack-internal:///./node_modules/qiniu-js/esm/errors/index.js:55:28)\n at xhr.onreadystatechange (webpack-internal:///./node_modules/qiniu-js/esm/utils/helper.js:248:24)" [[Prototype]] : QiniuError constructor : ƒ QiniuRequestError(code, reqId, message, data) [[Prototype]] : Object
这是一个错误信息,看起来是上传文件至七牛云存储时出现了问题,具体错误信息是“json: cannot unmarshal array into Go struct field CompleteMultipart.mimeType of type string”。需要检查代码中的上传参数是否正确,或者联系七牛云存储的支持团队进行帮助。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)