当我将文件上传到服务器时,响应是数字或布尔值,但我收到此错误:
Object {readyState:4,responseText:“”,status:200,statusText:“OK”} 退出 : (一个) 总是 : () 抓住 : (一个) DONE : () 失败 : () getAllResponseHeaders : () getResponseHeader : (一个) overrideMimeType : (一个) 管 : () 进展 : () 诺言 : (一个) readyState的 : 4 responseText的 : “” setRequestHeader : (A,B) 州 : () 状态 : 200 的StatusCode : (一个) 状态文本 : “好” 然后 : (B,d,E) 的原 : 对象
我的代码是:
> rollup -c
resolve failed: { Error: Cannot find module 'n'
at Function.Module._resolveFilename (module.js:472:15)
at Function.requireRelative.resolve (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/node_modules/require-relative/index.js:30:17)
at resolve (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/lib/serialize.js:25:26)
at findAndRemove (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/lib/serialize.js:67:11)
at /Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/lib/serialize.js:111:13
at Array.map (native)
at loadPreset (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/lib/serialize.js:103:29)
at module.exports (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/index.js:97:19)
at Object.<anonymous> (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/index.js:3:18)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at /Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:302:17
at Array.map (native)
at OptionManager.resolvePresets (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:270:20)
at OptionManager.mergePresets (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:259:10)
at OptionManager.mergeOptions (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:244:14)
at OptionManager.init (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:374:12) code: 'MODULE_NOT_FOUND' } n
mootools already loaded
resolve failed: { Error: Cannot find module 'foreman'
at Function.Module._resolveFilename (module.js:472:15)
at Function.requireRelative.resolve (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/node_modules/require-relative/index.js:30:17)
at resolve (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/lib/serialize.js:25:26)
at findAndRemove (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/lib/serialize.js:67:11)
at /Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/lib/serialize.js:111:13
at Array.map (native)
at loadPreset (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/lib/serialize.js:103:29)
at module.exports (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/index.js:97:19)
at Object.<anonymous> (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/index.js:3:18)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at /Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:302:17
at Array.map (native)
at OptionManager.resolvePresets (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:270:20)
at OptionManager.mergePresets (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:259:10)
at OptionManager.mergeOptions (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:244:14)
at OptionManager.init (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:374:12) code: 'MODULE_NOT_FOUND' } foreman
resolve failed: { Error: Cannot find module 'babel-runtime'
at Function.Module._resolveFilename (module.js:472:15)
at Function.requireRelative.resolve (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/node_modules/require-relative/index.js:30:17)
at resolve (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/lib/serialize.js:25:26)
at findAndRemove (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/lib/serialize.js:67:11)
at /Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/lib/serialize.js:111:13
at Array.map (native)
at loadPreset (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/lib/serialize.js:103:29)
at module.exports (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/node_modules/modify-babel-preset/index.js:97:19)
at Object.<anonymous> (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/babel-preset-es2015-rollup/index.js:3:18)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at /Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:302:17
at Array.map (native)
at OptionManager.resolvePresets (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:270:20)
at OptionManager.mergePresets (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:259:10)
at OptionManager.mergeOptions (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:244:14)
at OptionManager.init (/Users/thomasreggi/Desktop/PAS/PAS-api/node_modules/rollup-plugin-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:374:12) code: 'MODULE_NOT_FOUND' } babel-runtime
Test files must be run with the AVA CLI:
$ ava node_modules/.bin/rollup
当我使用几乎相同的代码(没有processData,contentType和缓存)用于没有文件的其他表单时它可以工作,但是对于文件(图像),我总是得到上述错误。我做错了什么?