dependencies in the wrong place with yarn - node.js

When I do yarn install && yarn workspace frontend install && yarn workspace backend install in my Typescript project (various package.json files below) the dependencies for (e.g.) Angular and CDK are all in the root node_modules folder, but when I run (e.g.) yarn workspace frontend ng build, I get An unhandled exception occurred: ENOENT: no such file or directory, lstat '/work/frontend/node_modules/#angular'. How do I get the dependencies in the right place?
Root package.json:
"name": "load-tester",
"version": "1.0.0",
"private": true,
"workspaces": [
"backend",
"frontend"
],
"scripts": {
"deploy": "yarn workspace frontend ng build && yarn workspace backend deploy"
},
"packageManager": "yarn#3.1.0",
"dependencies": {
"#aws-sdk/client-ec2": "^3.34.0",
"#aws-sdk/client-elastic-load-balancing-v2": "^3.34.0",
"#middy/http-content-negotiation": "^2.5.1",
"esbuild": "^0.12.28"
}
}
frontend/package.json
{
"name": "frontend",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"#angular/animations": "~12.2.0",
"#angular/cdk": "12.2.6",
"#angular/common": "~12.2.0",
"#angular/compiler": "~12.2.0",
"#angular/core": "~12.2.0",
"#angular/forms": "~12.2.0",
"#angular/material": "~12.2.6",
"#angular/platform-browser": "~12.2.0",
"#angular/platform-browser-dynamic": "~12.2.0",
"#angular/router": "~12.2.0",
"#aws-sdk/client-sns": "^3.34.0",
"#okta/okta-angular": "^4.1.0",
"#okta/okta-auth-js": "^5.6.0",
"rxjs": "~6.6.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "~12.2.5",
"#angular/cli": "~12.2.5",
"#angular/compiler-cli": "~12.2.0",
"#angular/localize": "^12.2.5",
"#types/jasmine": "~3.8.0",
"#types/node": "^12.11.1",
"jasmine-core": "~3.8.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.3.5"
}
}
backend/package.json
{
"name": "backend",
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"test": "jest",
"cdk": "cdk",
"deploy": "yarn build && yarn cdk deploy"
},
"devDependencies": {
"#aws-cdk/assert": "^1.121.0",
"#aws-cdk/aws-apigateway": "1.121.0",
"#aws-cdk/aws-apigatewayv2": "1.121.0",
"#aws-cdk/aws-apigatewayv2-integrations": "1.121.0",
"#aws-cdk/aws-certificatemanager": "1.121.0",
"#aws-cdk/aws-dynamodb": "1.121.0",
"#aws-cdk/aws-ecs": "^1.121.0",
"#aws-cdk/aws-ecs-patterns": "^1.121.0",
"#aws-cdk/aws-lambda": "1.121.0",
"#aws-cdk/aws-lambda-event-sources": "1.121.0",
"#aws-cdk/aws-lambda-nodejs": "1.121.0",
"#aws-cdk/aws-logs": "1.121.0",
"#aws-cdk/aws-s3-deployment": "1.121.0",
"#aws-cdk/aws-sqs": "^1.121.0",
"#aws-solutions-constructs/aws-cloudfront-s3": "1.121.0",
"#types/aws-lambda": "^8.10.83",
"#types/http-errors": "^1.8.1",
"#types/jest": "^27.0.1",
"#types/node": "^16.9.6",
"#types/source-map-support": "^0.5.4",
"aws-cdk": "^1.121.0",
"eslint": "^7.32.0",
"jest": "^27.2.0",
"json-schema-to-ts": "^1.6.4",
"ts-jest": "^27.0.5",
"ts-node": "^10.2.1",
"typescript": "^4.4.3"
},
"dependencies": {
"#aws-cdk/aws-apigatewayv2-authorizers": "^1.130.0",
"#aws-cdk/cloud-assembly-schema": "^1.121.0",
"#aws-cdk/core": "^1.121.0",
"#aws-cdk/cx-api": "^1.121.0",
"#aws-cdk/region-info": "^1.121.0",
"#aws-sdk/client-dynamodb": "^3.34.0",
"#aws-sdk/client-ecs": "^3.34.0",
"#aws-sdk/client-elastic-load-balancing-v2": "^3.34.0",
"#aws-sdk/client-route-53": "^3.34.0",
"#aws-sdk/client-s3": "^3.34.0",
"#aws-sdk/client-sqs": "^3.34.0",
"#aws-sdk/lib-dynamodb": "^3.34.0",
"#aws-sdk/signature-v4-crt": "^3.34.0",
"#dazn/lambda-powertools-logger": "^1.28.1",
"#dazn/lambda-powertools-pattern-basic": "^1.29.0",
"#middy/core": "^2.5.1",
"#middy/http-cors": "^2.5.1",
"#middy/http-error-handler": "^2.5.1",
"#middy/http-json-body-parser": "^2.5.1",
"#middy/http-multipart-body-parser": "^2.5.1",
"#middy/sqs-json-body-parser": "^2.5.1",
"#middy/validator": "^2.5.1",
"#okta/jwt-verifier": "^2.3.0",
"ajv": "^8.6.3",
"aws-lambda": "^1.0.6",
"constructs": "^3.2.0",
"exponential-backoff": "^3.1.0",
"http-errors": "^1.8.0",
"middy-jsonapi": "2.0.1",
"source-map-support": "^0.5.16"
}
}

The problem turned out to have been my angular.json; in particular anywhere referring to ./node_modules/#angular. When I changed that to ../node_modules/#angular I was able to successfully build both frontend and backend.

Related

Ng serve is working but ionic serve is failing

I'm building an app using Ionic 6.19.0 and it suddenly started to face building issues.
I get Error: spawn UNKNOWN each time I execute ionic serve.
This is my package.json file
{
"name": "stile",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular-devkit/schematics": "^13.3.3",
"#angular/common": "~13.0.0",
"#angular/core": "~13.0.0",
"#angular/forms": "~13.0.0",
"#angular/platform-browser": "~13.0.0",
"#angular/platform-browser-dynamic": "~13.0.0",
"#angular/router": "~13.0.0",
"#auth0/angular-jwt": "^5.0.2",
"#capacitor/android": "3.4.3",
"#capacitor/app": "1.1.0",
"#capacitor/camera": "^1.3.1",
"#capacitor/core": "3.4.0",
"#capacitor/haptics": "1.1.4",
"#capacitor/keyboard": "1.2.1",
"#capacitor/status-bar": "1.0.7",
"#ionic/angular": "^6.0.0",
"#npmcli/node-gyp": "^2.0.0",
"bootstrap": "^5.1.3",
"install": "^0.13.0",
"jquery": "^3.6.0",
"json-server": "^0.17.0",
"node-sass": "^7.0.1",
"npm": "^8.6.0",
"rxjs": "~6.6.0",
"tslib": "^2.3.1",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^13.3.3",
"#angular-eslint/builder": "^12.2.1",
"#angular-eslint/eslint-plugin": "~13.0.1",
"#angular-eslint/eslint-plugin-template": "~13.0.1",
"#angular-eslint/template-parser": "~13.0.1",
"#angular/cli": "~13.0.1",
"#angular/compiler": "~13.0.0",
"#angular/compiler-cli": "~13.0.0",
"#angular/language-service": "~13.0.0",
"#capacitor/cli": "3.4.0",
"#ionic/angular-toolkit": "^6.1.0",
"#popperjs/core": "^2.11.5",
"#types/jasmine": "~3.6.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"#typescript-eslint/eslint-plugin": "5.3.0",
"#typescript-eslint/parser": "5.3.0",
"acorn": "^8.7.0",
"ajv": "^6.12.6",
"eslint": "^7.6.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "30.7.6",
"eslint-plugin-prefer-arrow": "1.2.2",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"typescript": "~4.4.4"
},
"description": "An Ionic project"
}
Here are few solutions that might help:
Ensure you're in the root folder of your project.
Try fixing the existing node_modules folder with npm rebuild + reassign
permissions to your node_modules folder: chmod 755 -R
/path/to/node_modules
Remove node_modules and reinstall with npm install

Heroku seems to build client but I see no dist folder

When pushing my angular/node app to heroku it seems to build successfully when I look at the logs. But I can see no dist folder being created in the angular side.
I built the angular client locally to make sure there were no errors in the code.
I have changed the build script from -
"postinstall": "ng build --prod"
which was throwing "path to environment.prod.ts could not be found" error to
"heroku-postbuild": "ng build --configuration=production"
which doest throw errors but doesn't continue to create the dist folder. So I am stuck right a bit.
angular package.json
{
"name": "client",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "node app.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"heroku-postbuild": "ng build --configuration=production"
},
"private": true,
"dependencies": {
"#angular/cli": "~7.3.1",
"#angular/compiler-cli": "~7.2.0",
"typescript": "~3.2.2",
"#angular/animations": "^7.2.8",
"#angular/cdk": "^7.3.3",
"#angular/common": "~7.2.0",
"#angular/compiler": "~7.2.0",
"#angular/core": "~7.2.0",
"#angular/flex-layout": "^7.0.0-beta.24",
"#angular/forms": "~7.2.0",
"#angular/material": "^7.3.3",
"#angular/platform-browser": "~7.2.0",
"#angular/platform-browser-dynamic": "~7.2.0",
"#angular/router": "~7.2.0",
"#vguleaev/angular-material-autocomplete": "0.0.10",
"#w11k/ngx-componentdestroyed": "^4.1.4",
"core-js": "^2.5.4",
"rxjs": "~6.3.3",
"rxjs-observable-store": "^1.0.1",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.13.9",
"#angular/language-service": "~7.2.0",
"#types/jasmine": "~2.8.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0"
},
"engines": {
"node": "10.0.0",
"npm": "5.6.0"
}
}
node package.json
{
"name": "spotify-alias",
"version": "1.0.0",
"description": "",
"main": "app.js",
"engines": {
"node": "10.0.0",
"npm": "5.6.0"
},
"dependencies": {
"#babel/cli": "^7.5.5",
"#babel/core": "^7.5.5",
"#babel/node": "^7.5.0",
"#babel/preset-env": "^7.5.0",
"axios": "^0.19.0",
"concurrently": "^4.1.0",
"cookie-session": "^1.3.3",
"cors": "^2.8.5",
"express": "^4.16.4",
"mongoose": "^5.4.14",
"node-fetch": "^2.3.0",
"passport": "^0.4.0",
"passport-spotify": "^1.0.1"
},
"devDependencies": {
"nodemon": "^1.19.1"
},
"scripts": {
"start": "node app.js",
"server": "nodemon --exec babel-node app.js",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false && npm install --prefix client"
},
"author": "",
"license": "ISC"
}
app.js - node
if(process.env.NODE_ENV === 'production') {
app.use(express.static('/client/dist/index.html'));
const path = require('path');
app.get('*', (req, res) => {
res.sendFile(path.resolve(__dirname, "client", "dist", "index.html"));
});
}
I would like everything to build and the dist folder to be created. This is my first node app so please bear with me, there might be things that look completely off.
Like I am not 100% sure about the app.js code that resolves the path. I do know that /client is where the angular stuff is from root.
Any help much appreciated.
You do not have a build script. I see that you're using Babel. Thus, you need to tell Babel to run a build for you; which ultimately provides the dist folder (could be any name though).
"build": "babel src --out-dir dist --copy-files",
Do follow the blog to deploy angular apps on heroku
https://medium.com/#hellotunmbi/how-to-deploy-angular-application-to-heroku-1d56e09c5147

heroku/node deployment - cannot find module 'app/dist/server/app.js'

I've recently upgraded my angular2 app to angular 5 and I am having trouble deploying it to heroku where it used to work beforehand.
The issue here is that I have a Procfile that has this: 'web: node dist/server/app.js' - where the launch file is stored but heroku is trying to find it add this path - 'app/dist/server/app.js' I'm not sure where this /app is getting appended but it is causing the issue.
Cheers
error description
{
"name": "",
"version": "4.2.4",
"license": "",
"author": "",
"description": "",
"angular-cli": {},
"engines": {
"node": "8.9.4",
"npm": "5.6.0"
},
"scripts": {
"ng": "ng",
"build": "ng build --prod",
"start": "node dist/server/app.js",
"predev": "tsc -p server",
"dev": "node ./node_modules/mongodb-migrate -runmm -dbn dbSettings up && concurrently \"mongod\" \"ng serve -pc proxy.conf.json --open\" \"tsc -w -p server\" \"nodemon dist/server/app.js\"",
"prod": "concurrently \"mongod\" \"ng build -aot -prod && tsc -p server && node dist/server/app.js\"",
"test": "ng test",
"testbe": "tsc -p server && mocha dist/server/test --exit",
"lint": "ng lint",
"lintbe": "tslint server/**/**.ts{,x}",
"e2e": "ng e2e",
"migrations": "node ./node_modules/mongodb-migrate -runmm -dbn dbSettings up",
"create-migration": "node ./node_modules/mongodb-migrate -runmm create"
},
"private": true,
"dependencies": {
"#angular/animations": "^5.2.0",
"#angular/cdk": "2.0.0-beta.12",
"#angular/common": "^5.2.0",
"#angular/compiler": "^5.2.0",
"#angular/core": "^5.2.0",
"#angular/forms": "^5.2.0",
"#angular/http": "^5.2.0",
"#angular/material": "2.0.0-beta.12",
"#angular/platform-browser": "^5.2.0",
"#angular/platform-browser-dynamic": "^5.2.0",
"#angular/router": "^5.2.0",
"#sendgrid/mail": "^6.2.1",
"angular-bootstrap-md": "^5.1.2",
"angular2-jwt": "^0.2.3",
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.2",
"bootstrap": "4.0.0-alpha.5",
"cheerio": "^1.0.0-rc.2",
"core-js": "^2.4.1",
"cron": "^1.3.0",
"dotenv": "^4.0.0",
"express": "^4.16.3",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"jquery": "^3.3.1",
"jsonwebtoken": "^8.2.1",
"migrate-mongo": "^2.2.1",
"moment": "^2.20.1",
"mongodb-migrate": "^2.0.2",
"mongoose": "^5.0.13",
"morgan": "^1.9.0",
"popper.js": "^1.14.3",
"npm-check": "^5.6.0",
"redis": "^2.8.0",
"request": "^2.85.0",
"rxjs": "^5.5.6",
"tether": "1.4.0",
"zone.js": "^0.8.19"
},
"devDependencies": {
"#angular/cli": "~1.7.3",
"#angular/compiler-cli": "^5.2.0",
"#angular/language-service": "^5.2.0",
"#types/jasmine": "^2.8.6",
"#types/jasminewd2": "~2.0.2",
"#types/node": "~6.0.60",
"chai": "^4.1.2",
"chai-http": "^4.0.0",
"codelyzer": "~4.0.1",
"concurrently": "^3.5.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"mocha": "^5.0.5",
"nodemon": "^1.17.3",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
}
}
I once came across with a similar issue with a nodejs typescript application that I had connected with git. The .gitingnore file omits js files. So when heroku takes a pull from git it only obtains typescript script(no js files). Where as the npm start script refers to js files.
Another thing to note it that heroku runs only two commands
npm install
and
npm start
Solution
Add ng build into the start script so that production files are available for heroku.
package.json
"ng": "ng",
"build": "ng build --prod",
"start": "ng build --prod && node dist/server/app.js",

Error Not Yet Implemented with Webpack when run node dist/server.js

I were following the guide to implement Angular Universal for my application. Everything worked out well until the last command node dist/server.js throw an error Error: NotYetImplemented
The full traceback is here:
bash
Error: NotYetImplemented
at HTMLCanvasElement.exports.nyi (C:\Users\dist\server.js:50200:9)
at C:\Users\dist\server.js:238837:55
at Object.<anonymous> (C:\Users\dist\server.js:228511:20)
at svgNS (C:\Users\dist\server.js:228512:12)
at Object.defineProperty.value (C:\Users\dist\server.js:228520:2)
at __webpack_require__ (C:\Users\dist\server.js:20:30)
at Object.<anonymous> (C:\Users\dist\server.js:228463:14)
at __webpack_require__ (C:\Users\dist\server.js:20:30)
at Object.<anonymous> (C:\Users\dist\server.js:228427:89)
at __webpack_require__ (C:\Users\dist\server.js:20:30)
The current version of the packages in my application can be viewed here in package.json:
json
{
"name": "application",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build:ssr": "npm run build:client-and-server-bundles && npm run webpack:server",
"serve:ssr": "node dist/server.js",
"build:client-and-server-bundles": "ng build --production && ng build --production --app 1 --output-hashing=false",
"webpack:server": "webpack --config webpack.server.config.js --progress --colors",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"pre-commit": [
"ng lint -fix"
],
"dependencies": {
"#angular-devkit/core": "0.3.1",
"#angular/animations": "5.2.4",
"#angular/cli": "1.6.8",
"#angular/common": "5.2.4",
"#angular/compiler": "5.2.4",
"#angular/core": "5.2.4",
"#angular/forms": "5.2.4",
"#angular/http": "5.2.4",
"#angular/platform-browser": "5.2.4",
"#angular/platform-browser-dynamic": "5.2.4",
"#angular/platform-server": "5.2.4",
"#angular/router": "5.2.4",
"#ngui/auto-complete": "0.14.4",
"#nicky-lenaers/ngx-scroll-to": "0.3.1",
"#types/flickity": "2.0.0",
"angular-spinners": "5.0.2",
"angular2-drag-scroll": "1.5.2",
"bodymovin": "4.13.0",
"bootstrap-sass": "3.3.7",
"chart.js": "2.7.1",
"core-js": "2.5.3",
"express": "4.16.2",
"flickity": "2.0.10",
"font-awesome": "4.7.0",
"jquery": "3.2.1",
"ng-lottie": "0.3.1",
"ng-recaptcha": "3.0.3",
"ng-selectize": "1.1.3",
"ng2-charts": "1.6.0",
"ng2-device-detector": "1.0.1",
"ng2-input-autocomplete": "0.0.11",
"ngx-bootstrap": "2.0.2",
"ngx-cookie": "2.0.1",
"ngx-loading": "1.0.14",
"node-sass": "4.7.2",
"roboto-fontface": "0.8.0",
"rxjs": "5.5.6",
"selectize": "0.12.4",
"slick-carousel": "1.8.1",
"typescript": "^2.7.1",
"zone.js": "0.8.20"
},
"devDependencies": {
"#angular/compiler-cli": "5.2.4",
"#angular/language-service": "4.4.6",
"#types/jasmine": "2.8.6",
"#types/jasminewd2": "2.0.3",
"#types/node": "8.9.3",
"bootstrap-loader": "2.2.0",
"chalk": "2.3.1",
"codelyzer": "3.2.2",
"copy-webpack-plugin": "4.4.1",
"cssnano": "4.0.0-rc.2",
"domino": "2.0.0",
"enhanced-resolve": "4.0.0-beta.4",
"extract-text-webpack-plugin": "3.0.2",
"graceful-fs": "4.1.11",
"jasmine-core": "2.99.1",
"jasmine-spec-reporter": "4.2.1",
"jsdom": "11.6.2",
"karma": "1.7.1",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.4.1",
"karma-firefox-launcher": "1.1.0",
"karma-jasmine": "1.1.1",
"karma-jasmine-html-reporter": "0.2.2",
"lottie-web": "5.1.7",
"memory-fs": "0.4.1",
"npm-run-all": "4.1.2",
"protractor": "5.3.0",
"sass-lint": "1.12.1",
"tapable": "1.0.0-beta.5",
"ts-loader": "3.5.0",
"ts-node": "3.3.0",
"tslint": "5.9.1",
"uglify-js": "3.3.10",
"webpack": "3.11.0",
"webpack-dev-server": "2.11.1",
"webpack-merge": "3.0.0",
"webpack-node-externals": "1.6.0"
}
}
webpack.server.config.js
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
server: './src/server.ts'
},
resolve: {
extensions: ['.js', '.ts']
},
target: 'node',
// this makes sure we include node_modules and other 3rd party libraries
externals: [/(node_modules|main\..*\.js)/],
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js'
},
module: {
rules: [{
test: /\.ts$/,
loader: 'ts-loader'
}]
},
plugins: [
// Temporary Fix for issue: https://github.com/angular/angular/issues/11580
// for 'WARNING Critical dependency: the request of a dependency is an expression'
new webpack.ContextReplacementPlugin(
/(.+)?angular(\\|\/)core(.+)?/,
path.join(__dirname, 'src'), // location of your src
{} // a map of your routes
),
new webpack.ContextReplacementPlugin(
/(.+)?express(\\|\/)(.+)?/,
path.join(__dirname, 'src'), {}
)
]
};
Anyone saw the same problem can give me some insights? Many thanks!

ionic Cannot find module 'firebase/app' even if it is installed

I've cloned a working Ionic project from github and installed all the modules needed, also using npm install #firebase/app, but when running Ionic serve an error page is shown saying Cannot find module 'firebase/app'. When I installed firebase/app, it showed me this in the shell:
I guess there's a problem with the angularfire2 version that causes me the other problem? Which version should I use and how can I downgrade/upgrade that? To install angularfire2 I've simply run npm install angularfire2.
This is my package.json file:
{
"name": "progettoEM",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/common": "4.4.3",
"#angular/compiler": "4.4.3",
"#angular/compiler-cli": "4.4.3",
"#angular/core": "4.4.3",
"#angular/forms": "4.4.3",
"#angular/http": "4.4.3",
"#angular/platform-browser": "4.4.3",
"#angular/platform-browser-dynamic": "4.4.3",
"#firebase/app": "^0.1.5",
"#ionic-native/camera": "^4.5.2",
"#ionic-native/core": "4.3.0",
"#ionic-native/diagnostic": "^4.5.2",
"#ionic-native/file": "^4.5.2",
"#ionic-native/geolocation": "^4.5.2",
"#ionic-native/google-maps": "^4.5.2",
"#ionic-native/secure-storage": "^4.5.2",
"#ionic-native/splash-screen": "4.3.0",
"#ionic-native/status-bar": "4.3.0",
"#ionic/storage": "2.0.1",
"angularfire2": "^5.0.0-rc.4",
"graphhopper-js-api-client": "^0.9.0-3",
"ionic-angular": "3.7.1",
"ionic-img-viewer": "^2.9.0",
"ionicons": "3.0.0",
"leaflet": "^1.2.0",
"rxjs": "5.4.3",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"#ionic/app-scripts": "3.0.0",
"#ionic/cli-plugin-cordova": "1.6.2",
"#ionic/cli-plugin-ionic-angular": "1.4.1",
"ionic": "3.13.1",
"typescript": "2.3.4"
},
"description": "An Ionic project"
}
How do I resolve this problem?

Resources