Angular 4 - ASP.Net Core - Compiling error - asp.net

After having ejected webpack.config.js I use to compile my Angular project using the command: npm run build, lately while launched the build I got the following error:
ERROR in ./node_modules/#angular/http/#angular/http.es5.js
Module not found: Error: Can't resolve 'rxjs/operator/share'
in 'C:\...\node_modules#angular\c ore#angular'
# ./node_modules/#angular/core/#angular/core.es5.js 9:0-44
# ./ClientApp/main.ts # multi ./ClientApp/main.ts
Modules versions are as next:
#angular/cli: 1.4.9 (e)
node: 6.11.3
os: win32 x64
#angular/animations: 4.4.6
#angular/common: 4.4.6
#angular/compiler: 4.4.6
#angular/core: 4.4.6
#angular/forms: 4.4.6
#angular/http: 4.4.6
#angular/platform-browser: 4.4.6
#angular/platform-browser-dynamic: 4.4.6
#angular/router: 4.4.6
#angular/cli: 1.4.9
#angular/compiler-cli: 4.4.6
#angular/language-service: 4.4.6
#ngtools/webpack: 1.7.4
typescript: 2.7.0-dev.20171031
and here is the npm-debug log:
info it worked if it ends with ok
verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', verbose cli 'run', verbose cli 'build' ]
info using npm#3.10.10
info using node#v6.11.3
verbose run-script [ 'prebuild', 'build', 'postbuild' ]
info lifecycle ng2-asp-core#0.0.0~prebuild: ng2-asp-core#0.0.0
silly lifecycle ng2-asp-core#0.0.0~prebuild: no script for prebuild, continuing
info lifecycle ng2-asp-core#0.0.0~build: ng2-asp-core#0.0.0
verbose lifecycle ng2-asp-core#0.0.0~build: unsafe-perm in lifecycle true
verbose lifecycle ng2-asp-core#0.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;..............etc ......
verbose lifecycle ng2-asp-core#0.0.0~build: CWD: C:\MyApp
silly lifecycle ng2-asp-core#0.0.0~build: Args: [ '/d /s /c', 'webpack' ]
silly lifecycle ng2-asp-core#0.0.0~build: Returned: code: 2 signal: null
info lifecycle ng2-asp-core#0.0.0~build: Failed to exec build script
verbose stack Error: ng2-asp-core#0.0.0 build: `webpack` verbose stack Exit status 2 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16) verbose stack at emitTwo (events.js:106:13) verbose stack at EventEmitter.emit (events.js:191:7) verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14) verbose stack at emitTwo (events.js:106:13) verbose stack at ChildProcess.emit (events.js:191:7) verbose stack at maybeClose (internal/child_process.js:920:16) verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
verbose pkgid ng2-asp-core#0.0.0
verbose cwd C:\MyApp
error Windows_NT 10.0.14393
error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
error node v6.11.3
error npm v3.10.10
error code ELIFECYCLE
error ng2-asp-core#0.0.0 build: `webpack` error Exit status 2
error Failed at the ng2-asp-core#0.0.0 build script 'webpack'.
error Make sure you have the latest version of node.js and npm installed. error If you do, this is most likely a problem with the ng2-asp-core package, error not with npm itself. error Tell the author that this fails on your system: error webpack error You can get information on how to open an issue for this project with: error npm bugs ng2-asp-core error Or if that isn't available, you can get their info via: error npm owner ls ng2-asp-core error There is likely additional logging output above.
verbose exit [ 1, true ]
As the debug log points to ng2-asp-core package as error source, I have run the command npm owner ls ng2-asp-core to get the owner but got a 404 error: ng2-asp-core' is not in the npm registry^
Update: Package.json file:
{
"name": "ng2-asp-core",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "webpack-dev-server --port=4200",
"build": "webpack",
"test": "karma start ./karma.conf.js",
"lint": "ng lint",
"e2e": "protractor ./protractor.conf.js",
"pree2e": "webdriver-manager update --standalone false --gecko false --quiet"
},
"private": true,
"dependencies": {
"#angular/animations": "^4.2.4",
"#angular/common": "^4.2.4",
"#angular/compiler": "^4.2.4",
"#angular/core": "^4.2.4",
"#angular/forms": "^4.2.4",
"#angular/http": "^4.2.4",
"#angular/platform-browser": "^4.2.4",
"#angular/platform-browser-dynamic": "^4.2.4",
"#angular/router": "^4.2.4",
"core-js": "^2.4.1",
"rxjs": "^5.4.2",
"zone.js": "^0.8.14",
"lodash": "^4.17.4"
},
"devDependencies": {
"#angular/cli": "1.4.9",
"#angular/compiler-cli": "^4.2.4",
"#angular/language-service": "^4.2.4",
"#ngtools/webpack": "^1.7.4",
"#types/jasmine": "~2.5.53",
"#types/jasminewd2": "~2.0.2",
"#types/lodash": "^4.14.66",
"#types/node": "~6.0.60",
"autoprefixer": "^6.5.3",
"circular-dependency-plugin": "^3.0.0",
"codelyzer": "~3.2.0",
"copy-webpack-plugin": "^4.1.1",
"css-loader": "^0.28.1",
"cssnano": "^3.10.0",
"exports-loader": "^0.6.3",
"file-loader": "^1.1.5",
"html-webpack-plugin": "^2.29.0",
"istanbul-instrumenter-loader": "^2.0.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"less-loader": "^4.0.5",
"postcss-loader": "^1.3.3",
"postcss-url": "^5.1.2",
"protractor": "~5.1.2",
"raw-loader": "^0.5.1",
"sass-loader": "^6.0.3",
"source-map-loader": "^0.2.0",
"style-loader": "^0.13.1",
"stylus-loader": "^3.0.1",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.3.3",
"url-loader": "^0.6.2",
"webpack": "~3.7.1",
"webpack-concat-plugin": "1.4.0",
"webpack-dev-server": "~2.7.1",
"concurrently": "^3.2.0",
"lite-server": "^2.2.2"
}
}

It looks to me like you don't have rxjs installed so you should run npm install rxjs to fix.

Related

ionic cordova build error after install #ionic-native/firebase

I installed firebase in ionic application (https://ionicframework.com/docs/v3/native/firebase/)
after installing #ionic-native/firebase the app stops building (android version)
then I run
ionic cordova build android --prod --release
or
ionic cordova run android
these errors appear in the console
> Configure project :app
WARNING: The onesignal-gradle-plugin MUST be before com.android.application!
Please put onesignal-gradle-plugin first OR update to com.android.tools.build:gradle:3.0.0 or newer!
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
FAILURE: Build failed with an exception.
* Where:
Script 'app/platforms/android/cordova-support-google-services/app-build.gradle' line: 16
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
> For input string: "+"
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
Command finished with error code 1: app/platforms/android/gradlew cdvBuildDebug,-b,app/platforms/android/build.gradle
app/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Script 'app/platforms/android/cordova-support-google-services/app-build.gradle' line: 16
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
> For input string: "+"
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
Error: app/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Script 'app/platforms/android/cordova-support-google-services/app-build.gradle' line: 16
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
> For input string: "+"
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
at ChildProcess.whenDone (app/node_modules/cordova-common/src/superspawn.js:125:23)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at maybeClose (internal/child_process.js:927:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
[ERROR] An error occurred while running subprocess cordova.
cordova run android --verbose exited with exit code 1.
my dependencies in package.json
"dependencies": {
"#angular/common": "4.1.3",
"#angular/compiler": "4.1.3",
"#angular/compiler-cli": "4.1.3",
"#angular/core": "4.1.3",
"#angular/forms": "4.1.3",
"#angular/http": "4.1.3",
"#angular/platform-browser": "4.1.3",
"#angular/platform-browser-dynamic": "4.1.3",
"#ionic-native/core": "4.3.2",
"#ionic-native/facebook": "^4.2.1",
"#ionic-native/firebase": "3.14.0",
"#ionic-native/firebase-analytics": "^4.5.3",
"#ionic-native/in-app-browser": "^4.4.2",
"#ionic-native/keyboard": "^4.5.2",
"#ionic-native/onesignal": "^4.5.3",
"#ionic-native/social-sharing": "^4.2.1",
"#ionic-native/splash-screen": "3.12.1",
"#ionic-native/status-bar": "3.12.1",
"#ionic/storage": "2.0.1",
"#types/route-parser": "^0.1.1",
"cordova-android": "8.0.0",
"cordova-browser": "5.0.3",
"cordova-custom-config": "^5.1.0",
"cordova-ios": "4.5.4",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-customurlscheme": "^4.4.0",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-facebook4": "^1.10.1",
"cordova-plugin-firebase": "2.0.5",
"cordova-plugin-firebase-analytics": "^0.12.1",
"cordova-plugin-inappbrowser": "^1.7.2",
"cordova-plugin-ionic-webview": "^1.2.1",
"cordova-plugin-splashscreen": "^4.1.0",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "^5.4.1",
"cordova-support-google-services": "^1.0.0",
"es6-promise-plugin": "^4.2.2",
"font-awesome": "^4.7.0",
"fractional": "^1.0.0",
"humps": "^2.0.1",
"ionic-angular": "3.7.1",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"lodash": "^4.17.5",
"onesignal-cordova-plugin": "^2.4.1",
"pluralize": "^7.0.0",
"route-parser": "0.0.5",
"rxjs": "5.4.0",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.12"
},
"devDependencies": {
"#ionic/app-scripts": "3.2.3",
"typescript": "2.3.4"
},
"description": "Hybrid App",
"config": {
"ionic_copy": "./config/copy.config.js"
},
"cordova": {
"plugins": {
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-x-socialsharing": {},
"cordova-plugin-facebook4": {
"APP_ID": "xxxxxxxxxxxx",
"APP_NAME": "xxxxxxx"
},
"cordova-plugin-ionic-webview": {},
"cordova-support-google-services": {},
"cordova-plugin-firebase-analytics": {
"FIREBASE_VERSION": "11.0.+"
},
"onesignal-cordova-plugin": {},
"cordova-plugin-customurlscheme": {
"URL_SCHEME": "xxxxxxx",
"ANDROID_SCHEME": " ",
"ANDROID_HOST": " ",
"ANDROID_PATHPREFIX": "/"
},
"cordova-custom-config": {},
"cordova-plugin-firebase": {}
},
"platforms": [
"browser",
"ios",
"android"
]
}
ionic info
Ionic:
ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.7.1
#ionic/app-scripts : 3.2.3
Cordova:
cordova (Cordova CLI) : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : android 8.0.0
Cordova Plugins : cordova-plugin-ionic-webview 1.2.1, (and 13 other plugins)
app/platforms/android/cordova-support-google-services/app-build.gradle
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:+'
classpath 'com.google.gms:google-services:3.1.0'
}
}
// apply plugin: 'com.google.gms.google-services'
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
ext.postBuildExtras = {
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
}
It wasn`t possible to find a solution, maybe someone has encountered
this problem and will help to solve it.
Thank!

React Native build failed - "Error: While trying to resolve module `react-native-firebase`"

I am upgrading from RN 0.55.3 to 0.57.0 (manually).
After running react-native run-ios or react-native run-android I'm now getting the error:
error: bundling failed: Error: While trying to resolve module `react-native-firebase`
I already tried re-running react-native link react-native-firebase (per this post) as well as deleting node_modules and re-running yarn and neither worked.
Full error report:
error: bundling failed: Error: While trying to resolve module `react-native-firebase` from file `MyApp/src/screens/StarterPage.js`, the package `MyApp/node_modules/react-native-firebase/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`MyApp/node_modules/react-native-firebase/dist/index.js`. Indeed, none of these files exist:
* `MyApp/node_modules/react-native-firebase/dist/index.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
* `MyApp/node_modules/react-native-firebase/dist/index.js/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
at ResolutionRequest.resolveDependency (MyApp/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:95:15)
at DependencyGraph.resolveDependency (MyApp/node_modules/metro/src/node-haste/DependencyGraph.js:238:485)
at Object.resolve (MyApp/node_modules/metro/src/lib/transformHelpers.js:180:25)
at dependencies.map.result (MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:311:29)
at Array.map (<anonymous>)
at resolveDependencies (MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:307:16)
at MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:164:33
at Generator.next (<anonymous>)
at step (MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:307)
at MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:467
BUNDLE [ios, dev] ../../index.js ▓▓▓▓▓▓▓▓▓▓▓░░░░░ 73.4% (796/929)::1 - - [04/Jun/2019:00:27:03 +0000] "GET /index.bundle?platform=ios&dev=true&minify=false HTTP/1.1" 200 - "-" "MyApp/79 CFNetwork/978.0.7 Darwin/18.6.0"
BUNDLE [ios, dev] ../../index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░ 92.7% (904/939)
I checked and all these files are in node_modules/react-native-firebase. For instance, /dist/index.js is:
import firebase from './modules/core/firebase';
export default firebase;
export * from './modules/core/firebase';
/*
* Export App types
*/
My package.json
{
"name": "MyApp",
"version": "2.1.27",
"private": true,
"scripts": {
"clean:android": "./android/gradlew -p android/ clean && git clean -dfX -e *.iml android/build android/app/src",
"bundle:android": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res",
"build:android:release": "yarn clean:android && yarn bundle:android && ./android/gradlew -p android/ assembleRelease",
"run:android:release": "react-native run-android --variant=release",
"run:android:debug": "react-native run-android",
"test": "jest",
"android-linux": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && react-native run-android",
"eslint": "eslint —-ext .js ./src/",
"eslint:fix": "eslint --fix ./src/",
"flow": "flow",
"flow-stop": "flow stop",
"postinstall": "sed -i '' \"s/version.startsWith('iOS')/version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS')/g\" ./node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js"
},
"dependencies": {
"#babel/runtime": "^7.4.5",
"#react-native-community/async-storage": "^1.3.3",
"adm-zip": "^0.4.11",
"axios": "^0.18.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"base-64": "^0.1.0",
"d3-format": "^1.3.0",
"hoist-non-react-statics": "^3.0.1",
"lodash": "^4.17.11",
"moment": "^2.22.2",
"moment-timezone": "^0.5.17",
"piexifjs": "^2.0.0-beta.7",
"plist": "^3.0.1",
"prop-types": "^15.6.2",
"react": "16.5.0",
"react-native": "0.57.0",
"react-native-animatable": "^1.3.0",
"react-native-camera": "^1.6.3",
"react-native-carrier-info": "^1.0.1",
"react-native-circular-progress": "git+https://git#github.com/bartgryszko/react-native-circular-progress.git",
"react-native-confetti": "^0.1.0",
"react-native-contacts": "^2.2.3",
"react-native-country-picker-modal": "^0.5.1",
"react-native-datepicker": "^1.7.2",
"react-native-default-preference": "^1.3.1",
"react-native-device-info": "^0.21.5",
"react-native-dotenv": "^0.2.0",
"react-native-extended-stylesheet": "^0.8.1",
"react-native-fbsdk": "^0.8.0",
"react-native-firebase": "5.2.0",
"react-native-fs": "^2.13.3",
"react-native-image-crop-picker": "^0.24.0",
"react-native-keyboard-aware-scrollview": "^2.0.0",
"react-native-localization": "1.0.9",
"react-native-maps": "^0.22.1",
"react-native-mixpanel": "^1.1.1",
"react-native-modalbox": "^1.4.2",
"react-native-permissions": "^1.1.1",
"react-native-popover-tooltip": "^1.1.4",
"react-native-popup-menu": "^0.14.0",
"react-native-share": "^1.1.3",
"react-native-snap-carousel": "^3.7.5",
"react-native-sound": "^0.10.9",
"react-native-svg": "^9.2.4",
"react-native-svg-charts": "^5.2.0",
"react-native-swiper": "^1.5.13",
"react-native-version-number": "^0.3.4",
"react-native-webview-android-file-upload": "git+https://git#github.com/andreipfeiffer/react-native-webview-android-file-upload.git",
"react-navigation": "^1.5.11",
"xcode": "^1.0.0"
},
"devDependencies": {
"babel-jest": "24.7.1",
"babel-preset-react-native": "5.0.2",
"eslint-config-rallycoding": "^3.2.0",
"flow-bin": "^0.67.1",
"jest": "24.7.1",
"metro-react-native-babel-preset": "0.53.1",
"react-test-renderer": "16.5.0"
},
"jest": {
"preset": "react-native"
},
"rnpm": {
"assets": [
"./assets/fonts/"
]
}
}
I expect my app to run in the emulator (iOS) or on my phone (Android).
Have you tried resetting the watchman and Metro Bundler caches?
watchman watch-del-all
react-native start --reset-cache

Get BrowserslistError: Unknown browser query `dead` when try to compile the react application

I use in my project react template - React Isomorphic Redux Admin Dashboard
Try to compile the react app with this template:
1. npm install yarn install
2. npm run build dev or yarn run build
and every time I get this error when use yarn for instance:
yarn run v1.13.0
$ node build && node copy
Creating an optimized production build...
Failed to compile.
./node_modules/nprogress/nprogress.css
Module build failed: BrowserslistError: Unknown browser query dead
at Array.forEach ()
BrowserslistError when try to compile the react app with yarn
When I use npm I get the same error, but with different ....css file.
Here img of error with npm
BrowserslistError when try to compile the react app with npm
isomorphic#2.9.3 build /Users/romank/code/instagram/public
node build && node copy "dev"
Creating an optimized production build...
Failed to compile.
./src/containers/App/global.css
Module build failed: BrowserslistError: Unknown browser query dead
at Array.forEach ()
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! isomorphic#2.9.3 build: node build && node copy "dev"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the isomorphic#2.9.3 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/romank/.npm/_logs/2019-02-21T15_10_28_618Z-debug.log
Here is my package.json :
{
"name": "isomorphic",
"version": "2.9.3",
"private": true,
"dependencies": {
"antd": "^3.6.5",
"antd-local-icon": "^0.1.3",
"auth0-lock": "^11.1.2",
"autoprefixer": "7.1.6",
"babel-core": "6.26.0",
"babel-eslint": "7.2.3",
"babel-jest": "20.0.3",
"babel-loader": "^8.0.2",
"babel-preset-react-app": "^3.1.0",
"babel-runtime": "6.26.0",
"card-react": "^1.2.7",
"case-sensitive-paths-webpack-plugin": "2.1.1",
"chalk": "1.1.3",
"chart.js": "^2.5.0",
"classnames": "^2.2.5",
"clone": "^2.1.1",
"cp": "^0.2.0",
"cp-cli": "^1.1.2",
"cp-file": "^6.0.0",
"cp-folder": "^1.0.8",
"css-loader": "0.28.7",
"d3-shape": "^1.0.6",
"dotenv": "4.0.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-react-intl": "^1.4.8",
"eslint": "4.10.0",
"eslint-config-react-app": "^2.0.1",
"eslint-loader": "1.9.0",
"eslint-plugin-flowtype": "2.39.1",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-jsx-a11y": "5.1.1",
"eslint-plugin-react": "7.4.0",
"express": "^4.15.3",
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.5",
"firebase": "^5.2.0",
"fixed-data-table-2": "^0.8.8",
"frappe-charts": "^0.0.8",
"fs-extra": "^7.0.0",
"globalize": "^1.2.3",
"history": "^4.6.3",
"html-webpack-plugin": "2.29.0",
"immutable": "^3.8.1",
"immutable-devtools": "^0.0.7",
"jest": "20.0.4",
"js-info-bubble": "git+https://github.com/RedQ/js-info-bubble.git",
"js-rich-marker": "^1.1.2",
"lodash": "^4.17.4",
"moment": "^2.18.1",
"nprogress": "^0.2.0",
"object-assign": "4.1.1",
"polished": "^1.7.0",
"postcss-flexbugs-fixes": "3.2.0",
"postcss-inline-rtl": "^0.9.8",
"postcss-loader": "2.0.8",
"promise": "8.0.1",
"prop-types": "^15.5.10",
"raf": "3.4.0",
"react": "^16.2.0",
"react-addons-shallow-compare": "^15.5.2",
"react-big-calendar": "^0.17.0",
"react-chartjs-2": "^2.5.7",
"react-codemirror": "^1.0.0",
"react-count-down": "^1.1.0",
"react-dates": "12.2.4",
"react-dev-utils": "^4.2.1",
"react-dnd": "^2.3.0",
"react-dnd-html5-backend": "^2.3.0",
"react-dom": "^16.2.0",
"react-drawer": "^1.2.5",
"react-dropzone-component": "^3.0.0",
"react-element-resize": "^0.2.1",
"react-error-overlay": "1.0.6",
"react-flexbox-grid": "^2.0.0",
"react-flip-move": "^2.9.2",
"react-google-charts": "^1.6.0",
"react-grid-layout": "^0.16.2",
"react-instantsearch": "^4.0.7",
"react-intl": "^2.3.0",
"react-ladda": "^5.0.6",
"react-motion-drawer": "^2.1.7",
"react-perfect-scrollbar": "^0.2.0",
"react-placeholder": "^2.0.0",
"react-quill": "^1.2.0",
"react-redux": "^5.0.4",
"react-router": "^4.1.1",
"react-router-dom": "^4.1.0",
"react-router-redux": "^5.0.0-alpha.5",
"react-sidebar": "^2.3.2",
"react-smooth-scrollbar": "^8.0.6",
"react-speech-recognition": "^1.0.4",
"react-tag-input": "^4.7.2",
"react-tags": "^0.2.2",
"react-test-renderer": "^16.2.0",
"react-throttle": "^0.3.0",
"react-trend": "^1.2.3",
"react-vis": "^1.7.2",
"react-window-size-listener": "^1.0.10",
"react-yandex-maps": "^2.3.0",
"react-youtube": "^7.4.0",
"recharts": "^1.0.0-alpha.2",
"redux": "^3.6.0",
"redux-devtools": "^3.3.2",
"redux-devtools-dock-monitor": "^1.1.1",
"redux-devtools-log-monitor": "^1.2.0",
"redux-logger": "^3.0.6",
"redux-saga": "^0.16.0",
"redux-saga-firebase": "0.10.0",
"redux-thunk": "^2.2.0",
"reselect": "^3.0.0",
"rheostat": "^2.1.1",
"rich-marker": "^0.0.1",
"smooth-scrollbar": "^8.2.5",
"style-loader": "0.19.0",
"styled-components": "^2.2.1",
"styled-theme": "^0.3.3",
"sw-precache-webpack-plugin": "0.11.4",
"uppy": "^0.30.0",
"url-loader": "0.6.2",
"webpack": "3.8.1",
"webpack-dev-server": "2.9.4",
"webpack-manifest-plugin": "1.3.2",
"whatwg-fetch": "2.0.3",
"yandex-map-react": "^1.1.1"
},
"devDependencies": {
"#babel/core": "^7.1.0",
"#babel/plugin-proposal-class-properties": "^7.1.0",
"#babel/plugin-syntax-dynamic-import": "^7.0.0",
"#babel/preset-env": "^7.1.0",
"#babel/preset-react": "^7.0.0",
"babel-polyfill": "^6.26.0",
"enzyme": "^3.2.0",
"enzyme-to-json": "^3.3.0",
"fs-extra": "^7.0.0",
"google-maps-react": "^1.1.0",
"leaflet": "^1.2.0",
"leaflet-routing-machine": "^3.2.5",
"leaflet.markercluster": "^1.0.6",
"mv": "^2.1.1",
"react-app-rewired": "1.4.0",
"redux-mock-store": "^1.2.3",
"webpack-php-loader": "^0.5.0"
},
"scripts": {
"build": "node build && node copy"
},
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx,mjs}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}",
"<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs}"
],
"testEnvironment": "node",
"testURL": "http://localhost",
"transform": {
"^.+\\.(js|jsx|mjs)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|mjs|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web"
},
"moduleFileExtensions": [
"web.js",
"mjs",
"js",
"json",
"web.jsx",
"jsx",
"node"
]
},
"eslintConfig": {
"extends": "react-app"
}
}
How can I fix this error? Did anyone face to this problem?
By the way, how do better run the npm and yarn commands with sudo or without?
Thank you.

Issue using firebase-admin - dependencies were not found

I am developing an application by nuxtjs. I have installed the Admin SDK for Node.js to validate the user's token in the server side but when I import firebase-admin in the project I have the next issue. I have installed the modules child_process fs net tls but it didn' work.
WARNING Compiled with 4 warnings
20:30:20 warning in ./node_modules/grpc/src/grpc_extension.js
Critical dependency: the request of a dependency is an expression
warning in
./node_modules/grpc/node_modules/node-pre-gyp/lib/pre-binding.js
Critical dependency: the request of a dependency is an expression
warning in
./node_modules/grpc/node_modules/node-pre-gyp/lib/util/versioning.js
Critical dependency: the request of a dependency is an expression
warning in ./node_modules/hash-stream-validation/index.js
Module not found: Error: Can't resolve 'fast-crc32c' in
'C:\Users\ARSENIO\Desktop\Development\nuxt\project4\node_modules\hash-stream-
validation'
ERROR Failed to compile with 38 errors
20:30:20 These dependencies were not found:
child_process in ./node_modules/google-auth-library/build/src/auth/googleauth.js,
./node_modules/grpc/node_modules/detect-libc/lib/detect-libc.js
fs in ./node_modules/#google-cloud/storage/src/file.js, ./node_modules/#google-cloud/storage/src/bucket.js and 34 others
To install them, you can run: npm install --save child_process fs
The package.json file is:
{
"name": "project4",
"version": "1.0.0",
"description": "My gnarly Nuxt.js project",
"author": "Arsenio Aguirre",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint"
},
"dependencies": {
"bootstrap": "^4.1.3",
"bootstrap-vue": "^2.0.0-beta",
"chart.js": "^2.7.2",
"child_process": "^1.0.2",
"cross-env": "^5.2.0",
"firebase": "^5.5.3",
"firebase-admin": "^6.0.0",
"flag-icon-css": "^2.9.0",
"font-awesome": "^4.7.0",
"fs": "0.0.1-security",
"js-cookie": "^2.2.0",
"net": "^1.0.2",
"node-sass": "^4.9.3",
"nuxt": "^2.0.0",
"sass-loader": "^6.0.7",
"simple-line-icons": "^2.4.1",
"tls": "0.0.1",
"vue-chartjs": "^3.4.0"
},
"devDependencies": {
"nodemon": "^1.11.0",
"babel-eslint": "^8.2.1",
"eslint": "^5.0.1",
"eslint-loader": "^2.0.0",
"eslint-plugin-vue": "^4.0.0",
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-prettier": "2.6.2",
"prettier": "1.14.3"
}
}

How to firebase deploy through Bitbucket Pipeline?

I am using angular-cli project and I used Heroku for CD integration. And the repository is on Bitbucket.
Now I am going to use firebase deploy service through Bithubcket pipeline, so I tried as below.
package.json
{
"name": "mail-activator",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "ng build --prod",
"deploy": "firebase deploy --token $FIREBASE_TOKEN",
"start": "node server.js"
},
"private": true,
"dependencies": {
"#angular/animations": "^4.1.3",
"#angular/cli": "1.0.3",
"#angular/common": "^4.1.3",
"#angular/compiler": "^4.1.3",
"#angular/compiler-cli": "^4.1.3",
"#angular/core": "^4.1.3",
"#angular/forms": "^4.1.3",
"#angular/http": "^4.1.3",
"#angular/material": "^2.0.0-beta.5",
"#angular/platform-browser": "^4.1.3",
"#angular/platform-browser-dynamic": "^4.1.3",
"#angular/router": "^4.1.3",
"angular2-prettyjson": "^2.0.5",
"angularfire2": "^4.0.0-rc.0",
"bootstrap": "^4.0.0-alpha.6",
"core-js": "^2.4.1",
"express": "^4.15.3",
"firebase": "^4.0.0",
"firebase-tools": "^3.9.0",
"hammerjs": "^2.0.8",
"ng2-sweetalert2": "0.0.8",
"ngx-validators": "^3.0.0",
"promise-polyfill": "^6.0.2",
"rxjs": "^5.4.0",
"sweetalert2": "^6.6.3",
"zone.js": "^0.8.11"
},
"devDependencies": {
"#angular/cli": "1.0.3",
"#angular/compiler-cli": "^4.1.3",
"#types/jasmine": "2.5.47",
"#types/node": "~7.0.22",
"codelyzer": "~3.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.0.4",
"tslint": "~5.3.0",
"typescript": "~2.3.3"
}
}
and This is Bitbucket pipeline script.
image: node:7.6.0
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- npm install
- npm run postinstall
- npm run deploy
I tried this, but it says
i functions: preparing functions directory for uploading...
Error: Error parsing triggers: Cannot find module 'firebase-functions'
Try running "npm install" in your functions directory before deploying.
I am not sure if the bitbucket pipe line uses docker or some container? On Travis we installed firebase-tools as global.
npm install -g firebase-tools
But I am not sure it will works on bitbucket pipeline.
Any helps are welcomed.
Try using another image. There's an example that uses both angular cli and firebase tool for it. So you do something like:
image: gabrielaraujof/angular-cli
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- npm install
- ng build
- ng test --watch=false
- firebase deploy --token=$FIREBASE_TOKEN --project project-name-firebase --non-interactive
You get the "$FIREBASE_TOKEN" on firebasetool by running:
firebase login:ci
Save it on bit bucket's Environment variables(Settings > Environment variables) and run the pipeline

Resources