Git push build failed


#1

I try to ionic ‘local location’.
So I execute install command ‘$npm install --save @ionic-native/local-notifications’. It is success.
However, I try to next
git add .
git commit -m "first"
git push ionic master
-> Build Failed

build error log is:
Error: ./node_modules/@angular/common/esm5/common.js Module not found: Error: Can’t resolve ‘tslib’ in
’/usr/src/app/node_modules/@angular/common/esm5’ resolve ‘tslib’ in
’/usr/src/app/node_modules/@angular/common/esm5’ Parsed request is a module using description file:
/usr/src/app/node_modules/@angular/common/package.json (relative path: ./esm5) Field ‘browser’ doesn’t
contain a valid alias configuration after using description file:
/usr/src/app/node_modules/@angular/common/package.json (relative path: ./esm5) 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/esm5/common.js 7:0-44 @
./node_modules/@angular/platform-browser-dynamic/esm5/platform-browser-dynamic.js @
./src/app/main.ts,./node_modules/@angular/compiler/esm5/compiler.js Module not found: Error: Can’t resolve
’tslib’ in ‘/usr/src/app/node_modules/@angular/compiler/esm5’ resolve ‘tslib’ in
’/usr/src/app/node_modules/@angular/compiler/esm5’ Parsed request is a module using description file:
/usr/src/app/node_modules/@angular/compiler/package.json (relative path: ./esm5) Field ‘browser’ doesn’t
contain a valid alias configuration after using description file:
/usr/src/app/node_modules/@angular/compiler/package.json (relative path: ./esm5) 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/esm5/compiler.js 6:0-44 @
./node_modules/@angular/platform-browser-dynamic/esm5/platform-browser-dynamic.js @
./src/app/main.ts,./node_modules/@angular/core/esm5/core.js Module not found: Error: Can’t resolve ‘tslib’
in ‘/usr/src/app/node_modules/@angular/core/esm5’ resolve ‘tslib’ in
’/usr/src/app/node_modules/@angular/core/esm5’ Parsed request is a module using description file:
/usr/src/app/node_modules/@angular/core/package.json (relative path: ./esm5) Field ‘browser’ doesn’t contain
a valid alias configuration after using description file:
/usr/src/app/node_modules/@angular/core/package.json (relative path: ./esm5) 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/esm5/core.js 6:0-44 @ ./src/app/app.module.ts @
./src/app/main.ts,./node_modules/@angular/forms/esm5/forms.js Module not found: Error: Can’t resolve ‘tslib’
in ‘/usr/src/app/node_modules/@angular/forms/esm5’ resolve ‘tslib’ in
’/usr/src/app/node_modules/@angular/forms/esm5’ Parsed request is a module using description file:
/usr/src/app/node_modules/@angular/forms/package.json (relative path: ./esm5) Field ‘browser’ doesn’t
contain a valid alias configuration after using description file:
/usr/src/app/node_modules/@angular/forms/package.json (relative path: ./esm5) 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/forms/esm5/forms.js 6:0-44 @
./node_modules/ionic-angular/components/select/select.js @ ./node_modules/ionic-angular/index.js @
./src/app/app.module.ts @
./src/app/main.ts,./node_modules/@angular/platform-browser-dynamic/esm5/platform-browser-dynamic.js Module
not found: Error: Can’t resolve ‘tslib’ in
’/usr/src/app/node_modules/@angular/platform-browser-dynamic/esm5’ resolve ‘tslib’ in
’/usr/src/app/node_modules/@angular/platform-browser-dynamic/esm5’ Parsed request is a module using
description file: /usr/src/app/node_modules/@angular/platform-browser-dynamic/package.json (relative path:
./esm5) Field ‘browser’ doesn’t contain a valid alias configuration after using description file:
/usr/src/app/node_modules/@angular/platform-browser-dynamic/package.json (relative path: ./esm5) 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]
…and so on. it is so long

What is problem? How can I solve it?
(Ah, When I execute ‘npm install --save @ionic-native/geolocation’, I see the same error message!)


#2

Hello

I’m not an expert on npm but what I think is happening is your local dev environment has typescript / tslib installed globally with the -g flag so when you upload it to the build server it doesn’t have a way to get at it.

I just solved this for myself by going to the project and doing npm install tslib (you don’t need --save if you are on npm5).

Then I committed the changes to the repo and re-did the deploy line.

Then it completed successfully looking in the build in the logs in the dashboard.