我需要运行我的项目,所以我可以用手机测试它。
当我使用“离子实验室”运行时它工作正常,除了我无法访问cordova插件(我认为它是leggit)但是当我尝试“离子cordova运行android”时,我得到很多错误,我不明白。
这是我的第一个Ionic&科尔多瓦项目让我有点迷失在这里发生的所有事情。它在打字稿中。
Error: ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js
Module not found: Error: Can't resolve 'child_process' in 'vennel_ts\node_modules\xmlhttprequest\lib'
resolve 'child_process' in 'vennel_ts\node_modules\xmlhttprequest\lib'
Parsed request is a module
using description file: vennel_ts\node_modules\xmlhttprequest\package.json (relative path: ./lib)
Field 'browser' doesn't contain a valid alias configuration
after using description file: vennel_ts\node_modules\xmlhttprequest\package.json (relative path: ./lib)
resolve as module
looking for modules in vennel_ts\node_modules
using description file: vennel_ts\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: vennel_ts\package.json (relative path: ./node_modules)
using description file: vennel_ts\package.json (relative path: ./node_modules/child_process)
no extension
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\child_process doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\child_process.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\child_process.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\child_process.json doesn't exist
as directory
vennel_ts\node_modules\child_process doesn't exist
[vennel_ts\node_modules\child_process]
[vennel_ts\node_modules\child_process.ts]
[vennel_ts\node_modules\child_process.js]
[vennel_ts\node_modules\child_process.json]
[vennel_ts\node_modules\child_process]
@ ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js 15:12-36
@ ./node_modules/jQuery/lib/node-jquery.js
@ ./src/app/app.component.ts
@ ./src/app/app.module.ts
@ ./src/app/main.ts,./node_modules/jQuery/lib/node-jquery.js
Module not found: Error: Can't resolve 'jsdom' in 'vennel_ts\node_modules\jQuery\lib'
resolve 'jsdom' in 'vennel_ts\node_modules\jQuery\lib'
Parsed request is a module
using description file: vennel_ts\node_modules\jQuery\package.json (relative path: ./lib)
Field 'browser' doesn't contain a valid alias configuration
after using description file: vennel_ts\node_modules\jQuery\package.json (relative path: ./lib)
resolve as module
looking for modules in vennel_ts\node_modules
using description file: vennel_ts\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: vennel_ts\package.json (relative path: ./node_modules)
using description file: vennel_ts\package.json (relative path: ./node_modules/jsdom)
no extension
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\jsdom doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\jsdom.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\jsdom.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\jsdom.json doesn't exist
as directory
vennel_ts\node_modules\jsdom doesn't exist
[vennel_ts\node_modules\jsdom]
[vennel_ts\node_modules\jsdom.ts]
[vennel_ts\node_modules\jsdom.js]
[vennel_ts\node_modules\jsdom.json]
[vennel_ts\node_modules\jsdom]
@ ./node_modules/jQuery/lib/node-jquery.js 5:13-29
@ ./src/app/app.component.ts
@ ./src/app/app.module.ts
@ ./src/app/main.ts,./node_modules/jQuery/lib/node-jquery.js
Module not found: Error: Can't resolve 'location' in 'vennel_ts\node_modules\jQuery\lib'
resolve 'location' in 'vennel_ts\node_modules\jQuery\lib'
Parsed request is a module
using description file: vennel_ts\node_modules\jQuery\package.json (relative path: ./lib)
Field 'browser' doesn't contain a valid alias configuration
after using description file: vennel_ts\node_modules\jQuery\package.json (relative path: ./lib)
resolve as module
looking for modules in vennel_ts\node_modules
using description file: vennel_ts\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: vennel_ts\package.json (relative path: ./node_modules)
using description file: vennel_ts\package.json (relative path: ./node_modules/location)
no extension
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\location doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\location.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\location.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\location.json doesn't exist
as directory
vennel_ts\node_modules\location doesn't exist
[vennel_ts\node_modules\location]
[vennel_ts\node_modules\location.ts]
[vennel_ts\node_modules\location.js]
[vennel_ts\node_modules\location.json]
[vennel_ts\node_modules\location]
@ ./node_modules/jQuery/lib/node-jquery.js 13:24-43
@ ./src/app/app.component.ts
@ ./src/app/app.module.ts
@ ./src/app/main.ts,./node_modules/jQuery/lib/node-jquery.js
Module not found: Error: Can't resolve 'navigator' in 'vennel_ts\node_modules\jQuery\lib'
resolve 'navigator' in 'vennel_ts\node_modules\jQuery\lib'
Parsed request is a module
using description file: vennel_ts\node_modules\jQuery\package.json (relative path: ./lib)
Field 'browser' doesn't contain a valid alias configuration
after using description file: vennel_ts\node_modules\jQuery\package.json (relative path: ./lib)
resolve as module
looking for modules in vennel_ts\node_modules
using description file: vennel_ts\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: vennel_ts\package.json (relative path: ./node_modules)
using description file: vennel_ts\package.json (relative path: ./node_modules/navigator)
no extension
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\navigator doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\navigator.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\navigator.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
vennel_ts\node_modules\navigator.json doesn't exist
as directory
vennel_ts\node_modules\navigator doesn't exist
[vennel_ts\node_modules\navigator]
[vennel_ts\node_modules\navigator.ts]
[vennel_ts\node_modules\navigator.js]
[vennel_ts\node_modules\navigator.json]
[vennel_ts\node_modules\navigator]
@ ./node_modules/jQuery/lib/node-jquery.js 17:25-45
@ ./src/app/app.component.ts
@ ./src/app/app.module.ts
@ ./src/app/main.ts
at new BuildError (vennel_ts\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
at callback (vennel_ts\node_modules\@ionic\app-scripts\dist\webpack.js:121:28)
at emitRecords.err (vennel_ts\node_modules\webpack\lib\Compiler.js:269:13)
at Compiler.emitRecords (vennel_ts\node_modules\webpack\lib\Compiler.js:375:38)
at emitAssets.err (vennel_ts\node_modules\webpack\lib\Compiler.js:262:10)
at applyPluginsAsyncSeries1.err (vennel_ts\node_modules\webpack\lib\Compiler.js:368:12)
at next (vennel_ts\node_modules\tapable\lib\Tapable.js:218:11)
at Compiler.compiler.plugin (vennel_ts\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (vennel_ts\node_modules\tapable\lib\Tapable.js:222:13)
at Compiler.afterEmit (vennel_ts\node_modules\webpack\lib\Compiler.js:365:9)
当我尝试为Android或iOS构建时,这是Visual Studio Code发送给我的错误。