我在尝试构建应用时遇到了这个新错误。我不知道从哪里开始。错误是巨大的让我觉得这是许多包的共同点?
可能值得注意的是,由于我看到的另一个错误,我在此@angular/tsc-wrapped autoprefixer
之前安装了一个包。在angular-cli
github问题上,我看到人们用该软件包解决了这个问题。
在旁注中,第一个错误:
Error: ./node_modules/chart.js/src/core/core.helpers.js Module not found:
当我查看node_modules
文件夹时,我看到了确切的文件?有没有理由在它存在时找不到它?
[18:10:50] ionic-app-script task: "build"
[18:10:50] Error: ./node_modules/chart.js/src/core/core.helpers.js Module not found: Error: Can't resolve
'chartjs-color' in '/usr/src/app/node_modules/chart.js/src/core' resolve 'chartjs-color' in
'/usr/src/app/node_modules/chart.js/src/core' Parsed request is a module using description file:
/usr/src/app/node_modules/chart.js/package.json (relative path: ./src/core) Field 'browser' doesn't contain
a valid alias configuration after using description file: /usr/src/app/node_modules/chart.js/package.json
(relative path: ./src/core) resolve as module looking for modules in /usr/src/app/node_modules using
description file: /usr/src/app/package.json (relative path: ./node_modules) Field 'browser' doesn't contain
a valid alias configuration after using description file: /usr/src/app/package.json (relative path:
./node_modules) using description file: /usr/src/app/package.json (relative path:
./node_modules/chartjs-color) no extension Field 'browser' doesn't contain a valid alias configuration
/usr/src/app/node_modules/chartjs-color doesn't exist .ts Field 'browser' doesn't contain a valid alias
configuration /usr/src/app/node_modules/chartjs-color.ts doesn't exist .js Field 'browser' doesn't contain a
valid alias configuration /usr/src/app/node_modules/chartjs-color.js doesn't exist .json Field 'browser'
doesn't contain a valid alias configuration /usr/src/app/node_modules/chartjs-color.json doesn't exist as
directory /usr/src/app/node_modules/chartjs-color doesn't exist [/usr/src/app/node_modules/chartjs-color]
[/usr/src/app/node_modules/chartjs-color.ts] [/usr/src/app/node_modules/chartjs-color.js]
[/usr/src/app/node_modules/chartjs-color.json] [/usr/src/app/node_modules/chartjs-color] @
./node_modules/chart.js/src/core/core.helpers.js 5:12-36 @ ./node_modules/chart.js/src/chart.js @
./node_modules/ng2-charts/charts/charts.js @ ./node_modules/ng2-charts/index.js @ ./src/app/app.module.ts @
./src/app/main.ts,./node_modules/chart.js/src/core/core.element.js Module not found: Error: Can't resolve
'chartjs-color' in '/usr/src/app/node_modules/chart.js/src/core' resolve 'chartjs-color' in
'/usr/src/app/node_modules/chart.js/src/core' Parsed request is a module using description file:
/usr/src/app/node_modules/chart.js/package.json (relative path: ./src/core) Field 'browser' doesn't contain
a valid alias configuration after using description file: /usr/src/app/node_modules/chart.js/package.json
(relative path: ./src/core) resolve as module looking for modules in /usr/src/app/node_modules using
description file: /usr/src/app/package.json (relative path: ./node_modules) Field 'browser' doesn't contain
a valid alias configuration after using description file: /usr/src/app/package.json (relative path:
./node_modules) using description file: /usr/src/app/package.json (relative path:
./node_modules/chartjs-color) no extension Field 'browser' doesn't contain a valid alias configuration
/usr/src/app/node_modules/chartjs-color doesn't exist .ts Field 'browser' doesn't contain a valid alias
configuration /usr/src/app/node_modules/chartjs-color.ts doesn't exist .js Field 'browser' doesn't contain a
valid alias configuration /usr/src/app/node_modules/chartjs-color.js doesn't exist .json Field 'browser'
doesn't contain a valid alias configuration /usr/src/app/node_modules/chartjs-color.json doesn't exist as
directory /usr/src/app/node_modules/chartjs-color doesn't exist [/usr/src/app/node_modules/chartjs-color]
[/usr/src/app/node_modules/chartjs-color.ts] [/usr/src/app/node_modules/chartjs-color.js]
[/usr/src/app/node_modules/chartjs-color.json] [/usr/src/app/node_modules/chartjs-color] @
./node_modules/chart.js/src/core/core.element.js 3:12-36 @ ./node_modules/chart.js/src/chart.js @
./node_modules/ng2-charts/charts/charts.js @ ./node_modules/ng2-charts/index.js @ ./src/app/app.module.ts @
./src/app/main.ts,./node_modules/dragula/dragula.js Module not found: Error: Can't resolve 'contra/emitter'
in '/usr/src/app/node_modules/dragula' resolve 'contra/emitter' in '/usr/src/app/node_modules/dragula'
Parsed request is a module using description file: /usr/src/app/node_modules/dragula/package.json (relative
path: .) Field 'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/node_modules/dragula/package.json (relative path: .) resolve as module looking for modules in
/usr/src/app/node_modules using description file: /usr/src/app/package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/package.json (relative path: ./node_modules) using description file: /usr/src/app/package.json
(relative path: ./node_modules/contra/emitter) no extension Field 'browser' doesn't contain a valid alias
configuration /usr/src/app/node_modules/contra/emitter doesn't exist .ts Field 'browser' doesn't contain a
valid alias configuration /usr/src/app/node_modules/contra/emitter.ts doesn't exist .js Field 'browser'
doesn't contain a valid alias configuration /usr/src/app/node_modules/contra/emitter.js doesn't exist .json
Field 'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/contra/emitter.json
doesn't exist as directory /usr/src/app/node_modules/contra/emitter doesn't exist
[/usr/src/app/node_modules/contra/emitter] [/usr/src/app/node_modules/contra/emitter.ts]
[/usr/src/app/node_modules/contra/emitter.js] [/usr/src/app/node_modules/contra/emitter.json]
[/usr/src/app/node_modules/contra/emitter] @ ./node_modules/dragula/dragula.js 3:14-39 @
./node_modules/ng2-dragula/components/dragula.class.js @
./node_modules/ng2-dragula/components/dragula.provider.js @ ./node_modules/ng2-dragula/index.js @
./src/app/app.module.ts @ ./src/app/main.ts,./node_modules/dragula/dragula.js Module not found: Error: Can't
resolve 'crossvent' in '/usr/src/app/node_modules/dragula' resolve 'crossvent' in
'/usr/src/app/node_modules/dragula' Parsed request is a module using description file:
/usr/src/app/node_modules/dragula/package.json (relative path: .) Field 'browser' doesn't contain a valid
alias configuration after using description file: /usr/src/app/node_modules/dragula/package.json (relative
path: .) resolve as module looking for modules in /usr/src/app/node_modules using description file:
/usr/src/app/package.json (relative path: ./node_modules) Field 'browser' doesn't contain a valid alias
configuration after using description file: /usr/src/app/package.json (relative path: ./node_modules) using
description file: /usr/src/app/package.json (relative path: ./node_modules/crossvent) no extension Field
'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/crossvent doesn't exist .ts
Field 'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/crossvent.ts doesn't
exist .js Field 'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/crossvent.js
doesn't exist .json Field 'browser' doesn't contain a valid alias configuration
/usr/src/app/node_modules/crossvent.json doesn't exist as directory /usr/src/app/node_modules/crossvent
doesn't exist [/usr/src/app/node_modules/crossvent] [/usr/src/app/node_modules/crossvent.ts]
[/usr/src/app/node_modules/crossvent.js] [/usr/src/app/node_modules/crossvent.json]
[/usr/src/app/node_modules/crossvent] @ ./node_modules/dragula/dragula.js 4:16-36 @
./node_modules/ng2-dragula/components/dragula.class.js @
./node_modules/ng2-dragula/components/dragula.provider.js @ ./node_modules/ng2-dragula/index.js @
./src/app/app.module.ts @ ./src/app/main.ts,./node_modules/@ionic/storage/es2015/storage.js Module not
found: Error: Can't resolve 'localforage' in '/usr/src/app/node_modules/@ionic/storage/es2015' resolve
'localforage' in '/usr/src/app/node_modules/@ionic/storage/es2015' Parsed request is a module using
description file: /usr/src/app/node_modules/@ionic/storage/package.json (relative path: ./es2015) Field
'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/node_modules/@ionic/storage/package.json (relative path: ./es2015) resolve as module looking
for modules in /usr/src/app/node_modules using description file: /usr/src/app/package.json (relative path:
./node_modules) Field 'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/package.json (relative path: ./node_modules) using description file: /usr/src/app/package.json
(relative path: ./node_modules/localforage) no extension Field 'browser' doesn't contain a valid alias
configuration /usr/src/app/node_modules/localforage doesn't exist .ts Field 'browser' doesn't contain a
valid alias configuration /usr/src/app/node_modules/localforage.ts doesn't exist .js Field 'browser' doesn't
contain a valid alias configuration /usr/src/app/node_modules/localforage.js doesn't exist .json Field
'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/localforage.json doesn't
exist as directory /usr/src/app/node_modules/localforage doesn't exist
[/usr/src/app/node_modules/localforage] [/usr/src/app/node_modules/localforage.ts]
[/usr/src/app/node_modules/localforage.js] [/usr/src/app/node_modules/localforage.json]
[/usr/src/app/node_modules/localforage] @ ./node_modules/@ionic/storage/es2015/storage.js 2:0-38 @
./node_modules/@ionic/storage/es2015/index.js @ ./src/app/app.module.ts @
./src/app/main.ts,./node_modules/@ionic/storage/es2015/storage.js Module not found: Error: Can't resolve
'localforage-cordovasqlitedriver' in '/usr/src/app/node_modules/@ionic/storage/es2015' resolve
'localforage-cordovasqlitedriver' in '/usr/src/app/node_modules/@ionic/storage/es2015' Parsed request is a
module using description file: /usr/src/app/node_modules/@ionic/storage/package.json (relative path:
./es2015) Field 'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/node_modules/@ionic/storage/package.json (relative path: ./es2015) resolve as module looking
for modules in /usr/src/app/node_modules using description file: /usr/src/app/package.json (relative path:
./node_modules) Field 'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/package.json (relative path: ./node_modules) using description file: /usr/src/app/package.json
(relative path: ./node_modules/localforage-cordovasqlitedriver) no extension Field 'browser' doesn't contain
a valid alias configuration /usr/src/app/node_modules/localforage-cordovasqlitedriver doesn't exist .ts
Field 'browser' doesn't contain a valid alias configuration
/usr/src/app/node_modules/localforage-cordovasqlitedriver.ts doesn't exist .js Field 'browser' doesn't
contain a valid alias configuration /usr/src/app/node_modules/localforage-cordovasqlitedriver.js doesn't
exist .json Field 'browser' doesn't contain a valid alias configuration
/usr/src/app/node_modules/localforage-cordovasqlitedriver.json doesn't exist as directory
/usr/src/app/node_modules/localforage-cordovasqlitedriver doesn't exist
[/usr/src/app/node_modules/localforage-cordovasqlitedriver]
[/usr/src/app/node_modules/localforage-cordovasqlitedriver.ts]
[/usr/src/app/node_modules/localforage-cordovasqlitedriver.js]
[/usr/src/app/node_modules/localforage-cordovasqlitedriver.json]
[/usr/src/app/node_modules/localforage-cordovasqlitedriver] @
./node_modules/@ionic/storage/es2015/storage.js 3:0-66 @ ./node_modules/@ionic/storage/es2015/index.js @
./src/app/app.module.ts @ ./src/app/main.ts,./node_modules/angular2-masonry/src/masonry.ts Module not found:
Error: Can't resolve 'masonry-layout' in '/usr/src/app/node_modules/angular2-masonry/src' resolve
'masonry-layout' in '/usr/src/app/node_modules/angular2-masonry/src' Parsed request is a module using
description file: /usr/src/app/node_modules/angular2-masonry/package.json (relative path: ./src) Field
'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/node_modules/angular2-masonry/package.json (relative path: ./src) resolve as module looking for
modules in /usr/src/app/node_modules using description file: /usr/src/app/package.json (relative path:
./node_modules) Field 'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/package.json (relative path: ./node_modules) using description file: /usr/src/app/package.json
(relative path: ./node_modules/masonry-layout) no extension Field 'browser' doesn't contain a valid alias
configuration /usr/src/app/node_modules/masonry-layout doesn't exist .ts Field 'browser' doesn't contain a
valid alias configuration /usr/src/app/node_modules/masonry-layout.ts doesn't exist .js Field 'browser'
doesn't contain a valid alias configuration /usr/src/app/node_modules/masonry-layout.js doesn't exist .json
Field 'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/masonry-layout.json
doesn't exist as directory /usr/src/app/node_modules/masonry-layout doesn't exist
[/usr/src/app/node_modules/masonry-layout] [/usr/src/app/node_modules/masonry-layout.ts]
[/usr/src/app/node_modules/masonry-layout.js] [/usr/src/app/node_modules/masonry-layout.json]
[/usr/src/app/node_modules/masonry-layout] @ ./node_modules/angular2-masonry/src/masonry.ts 13:14-39 @
./node_modules/angular2-masonry/index.ts @ ./src/app/app.module.ts @
./src/app/main.ts,./node_modules/angular2-text-mask/dist/angular2TextMask.js Module not found: Error: Can't
resolve 'text-mask-core/dist/textMaskCore' in '/usr/src/app/node_modules/angular2-text-mask/dist' resolve
'text-mask-core/dist/textMaskCore' in '/usr/src/app/node_modules/angular2-text-mask/dist' Parsed request is
a module using description file: /usr/src/app/node_modules/angular2-text-mask/package.json (relative path:
./dist) Field 'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/node_modules/angular2-text-mask/package.json (relative path: ./dist) resolve as module looking
for modules in /usr/src/app/node_modules using description file: /usr/src/app/package.json (relative path:
./node_modules) Field 'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/package.json (relative path: ./node_modules) using description file: /usr/src/app/package.json
(relative path: ./node_modules/text-mask-core/dist/textMaskCore) no extension Field 'browser' doesn't
contain a valid alias configuration /usr/src/app/node_modules/text-mask-core/dist/textMaskCore doesn't exist
.ts Field 'browser' doesn't contain a valid alias configuration
/usr/src/app/node_modules/text-mask-core/dist/textMaskCore.ts doesn't exist .js Field 'browser' doesn't
contain a valid alias configuration /usr/src/app/node_modules/text-mask-core/dist/textMaskCore.js doesn't
exist .json Field 'browser' doesn't contain a valid alias configuration
/usr/src/app/node_modules/text-mask-core/dist/textMaskCore.json doesn't exist as directory
/usr/src/app/node_modules/text-mask-core/dist/textMaskCore doesn't exist
[/usr/src/app/node_modules/text-mask-core/dist/textMaskCore]
[/usr/src/app/node_modules/text-mask-core/dist/textMaskCore.ts]
[/usr/src/app/node_modules/text-mask-core/dist/textMaskCore.js]
[/usr/src/app/node_modules/text-mask-core/dist/textMaskCore.json]
[/usr/src/app/node_modules/text-mask-core/dist/textMaskCore] @
./node_modules/angular2-text-mask/dist/angular2TextMask.js 17:21-64 118:21-64 @ ./src/app/app.module.ts @
./src/app/main.ts,./node_modules/@angular/animations/@angular/animations/browser.es5.js Module not found:
Error: Can't resolve 'tslib' in '/usr/src/app/node_modules/@angular/animations/@angular/animations' resolve
'tslib' in '/usr/src/app/node_modules/@angular/animations/@angular/animations' Parsed request is a module
using description file: /usr/src/app/node_modules/@angular/animations/package.json (relative path:
./@angular/animations) Field 'browser' doesn't contain a valid alias configuration after using description
file: /usr/src/app/node_modules/@angular/animations/package.json (relative path: ./@angular/animations)
resolve as module looking for modules in /usr/src/app/node_modules using description file:
/usr/src/app/package.json (relative path: ./node_modules) Field 'browser' doesn't contain a valid alias
configuration after using description file: /usr/src/app/package.json (relative path: ./node_modules) using
description file: /usr/src/app/package.json (relative path: ./node_modules/tslib) no extension Field
'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/tslib doesn't exist .ts
Field 'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/tslib.ts doesn't exist
.js Field 'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/tslib.js doesn't
exist .json Field 'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/tslib.json
doesn't exist as directory /usr/src/app/node_modules/tslib doesn't exist [/usr/src/app/node_modules/tslib]
[/usr/src/app/node_modules/tslib.ts] [/usr/src/app/node_modules/tslib.js]
[/usr/src/app/node_modules/tslib.json] [/usr/src/app/node_modules/tslib] @
./node_modules/@angular/animations/@angular/animations/browser.es5.js 1:0-33 @
./node_modules/@angular/platform-browser/@angular/platform-browser/animations.es5.js @
./src/app/app.module.ts @ ./src/app/main.ts,./node_modules/@angular/common/@angular/common.es5.js Module not
found: Error: Can't resolve 'tslib' in '/usr/src/app/node_modules/@angular/common/@angular' resolve 'tslib'
in '/usr/src/app/node_modules/@angular/common/@angular' Parsed request is a module using description file:
/usr/src/app/node_modules/@angular/common/package.json (relative path: ./@angular) Field 'browser' doesn't
contain a valid alias configuration after using description file:
/usr/src/app/node_modules/@angular/common/package.json (relative path: ./@angular) resolve as module looking
for modules in /usr/src/app/node_modules using description file: /usr/src/app/package.json (relative path:
./node_modules) Field 'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/package.json (relative path: ./node_modules) using description file: /usr/src/app/package.json
(relative path: ./node_modules/tslib) no extension Field 'browser' doesn't contain a valid alias
configuration /usr/src/app/node_modules/tslib doesn't exist .ts Field 'browser' doesn't contain a valid
alias configuration /usr/src/app/node_modules/tslib.ts doesn't exist .js Field 'browser' doesn't contain a
valid alias configuration /usr/src/app/node_modules/tslib.js doesn't exist .json Field 'browser' doesn't
contain a valid alias configuration /usr/src/app/node_modules/tslib.json doesn't exist as directory
/usr/src/app/node_modules/tslib doesn't exist [/usr/src/app/node_modules/tslib]
[/usr/src/app/node_modules/tslib.ts] [/usr/src/app/node_modules/tslib.js]
[/usr/src/app/node_modules/tslib.json] [/usr/src/app/node_modules/tslib] @
./node_modules/@angular/common/@angular/common.es5.js 1:0-33 @
./node_modules/@angular/platform-browser-dynamic/@angular/platform-browser-dynamic.es5.js @
./src/app/main.ts,./node_modules/@angular/compiler/@angular/compiler.es5.js Module not found: Error: Can't
resolve 'tslib' in '/usr/src/app/node_modules/@angular/compiler/@angular' resolve 'tslib' in
'/usr/src/app/node_modules/@angular/compiler/@angular' Parsed request is a module using description file:
/usr/src/app/node_modules/@angular/compiler/package.json (relative path: ./@angular) Field 'browser' doesn't
contain a valid alias configuration after using description file:
/usr/src/app/node_modules/@angular/compiler/package.json (relative path: ./@angular) resolve as module
looking for modules in /usr/src/app/node_modules using description file: /usr/src/app/package.json (relative
path: ./node_modules) Field 'browser' doesn't contain a valid alias configuration after using description
file: /usr/src/app/package.json (relative path: ./node_modules) using description file:
/usr/src/app/package.json (relative path: ./node_modules/tslib) no extension Field 'browser' doesn't contain
a valid alias configuration /usr/src/app/node_modules/tslib doesn't exist .ts Field 'browser' doesn't
contain a valid alias configuration /usr/src/app/node_modules/tslib.ts doesn't exist .js Field 'browser'
doesn't contain a valid alias configuration /usr/src/app/node_modules/tslib.js doesn't exist .json Field
'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/tslib.json doesn't exist as
directory /usr/src/app/node_modules/tslib doesn't exist [/usr/src/app/node_modules/tslib]
[/usr/src/app/node_modules/tslib.ts] [/usr/src/app/node_modules/tslib.js]
[/usr/src/app/node_modules/tslib.json] [/usr/src/app/node_modules/tslib] @
./node_modules/@angular/compiler/@angular/compiler.es5.js 1:0-33 @
./node_modules/@angular/platform-browser-dynamic/@angular/platform-browser-dynamic.es5.js @
./src/app/main.ts,./node_modules/@angular/core/@angular/core.es5.js Module not found: Error: Can't resolve
'tslib' in '/usr/src/app/node_modules/@angular/core/@angular' resolve 'tslib' in
'/usr/src/app/node_modules/@angular/core/@angular' Parsed request is a module using description file:
/usr/src/app/node_modules/@angular/core/package.json (relative path: ./@angular) Field 'browser' doesn't
contain a valid alias configuration after using description file:
/usr/src/app/node_modules/@angular/core/package.json (relative path: ./@angular) resolve as module looking
for modules in /usr/src/app/node_modules using description file: /usr/src/app/package.json (relative path:
./node_modules) Field 'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/package.json (relative path: ./node_modules) using description file: /usr/src/app/package.json
(relative path: ./node_modules/tslib) no extension Field 'browser' doesn't contain a valid alias
configuration /usr/src/app/node_modules/tslib doesn't exist .ts Field 'browser' doesn't contain a valid
alias configuration /usr/src/app/node_modules/tslib.ts doesn't exist .js Field 'browser' doesn't contain a
valid alias configuration /usr/src/app/node_modules/tslib.js doesn't exist .json Field 'browser' doesn't
contain a valid alias configuration /usr/src/app/node_modules/tslib.json doesn't exist as directory
/usr/src/app/node_modules/tslib doesn't exist [/usr/src/app/node_modules/tslib]
[/usr/src/app/node_modules/tslib.ts] [/usr/src/app/node_modules/tslib.js]
[/usr/src/app/node_modules/tslib.json] [/usr/src/app/node_modules/tslib] @
./node_modules/@angular/core/@angular/core.es5.js 1:0-33 @ ./src/app/app.module.ts @
./src/app/main.ts,./node_modules/@angular/forms/@angular/forms.es5.js Module not found: Error: Can't resolve
'tslib' in '/usr/src/app/node_modules/@angular/forms/@angular' resolve 'tslib' in
'/usr/src/app/node_modules/@angular/forms/@angular' Parsed request is a module using description file:
/usr/src/app/node_modules/@angular/forms/package.json (relative path: ./@angular) Field 'browser' doesn't
contain a valid alias configuration after using description file:
/usr/src/app/node_modules/@angular/forms/package.json (relative path: ./@angular) resolve as module looking
for modules in /usr/src/app/node_modules using description file: /usr/src/app/package.json (relative path:
./node_modules) Field 'browser' doesn't contain a valid alias configuration after using description file:
/usr/src/app/package.json (relative path: ./node_modules) using description file: /usr/src/app/package.json
(relative path: ./node_modules/tslib) no extension Field 'browser' doesn't contain a valid alias