Angular: 9.1.0
Firebase: 7.13.1
AngularFire: 6.0.0
Other (e.g. Ionic/Cordova, Node, browser, operating system):
Node 10.16.1, Windows 10
Steps to set up and reproduce
ng new xng add @nguniversal/express-engineng add @angular/firenpm install firebaseng deploy --preview or ng deploy
Described in Step 2 of Deploy your application on Firebase Hosting & Functions
When running ng deploy --preview, after compiling the bundles the terminal throws this error:
Command failed: npm ls || true
npm ERR! peer dep missing: node-sass@^4.0.0, required by [email protected]
npm ERR! peer dep missing: fibers@>= 3.1.0, required by [email protected]
npm ERR! peer dep missing: html-webpack-plugin@^2.21.0 || ~3 || >=4.0.0-alpha.2 <5, required by [email protected]
npm ERR! peer dep missing: canvas@^2.5.0, required by [email protected]
"true" is not recognized as an internal or external command,
program or executable batch file.
Same result with ng deploy
Ah sorry about that. It鈥檚 shelling out to a Unix true to capture the failure. I鈥檒l make that more robust & test in my Windows machine. Thanks!
I managed to run ng deploy via WSL. I'm using VS Code, it lets me using Linux based environment to develop. Try it out until it is fixed.
I have no error when npm run build:ssr , but when npm run serve:ssr ERROR
Error enabling offline persistence. Falling back to persistence disabled: Error: ENOENT: no such file or directory, open 'C:\myprojects\myproject9\dist\myproject9\server\src\protos\google\firestore\v1\firestore.proto'
npm ERR! code ELIFECYCLE
npm ERR! errno 3221225725
npm ERR! [email protected] serve:ssr: node dist/myproject9/server/main.js
npm ERR! Exit status 3221225725
npm ERR!
npm ERR! Failed at the [email protected] serve:ssr 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! C:\Users\faye_\AppData\Roaming\npm-cache_logs2020-05-04T09_47_56_360Z-debug.log
my package.json as follow
{
"name": "myproject9",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"dev:ssr": "ng run myproject9:serve-ssr",
"serve:ssr": "node dist/myproject9/server/main.js",
"build:ssr": "ng build --prod && ng run myproject9:server:production",
"prerender": "ng run myproject9:prerender",
"prebuild:ssr": "ngcc"
},
"private": true,
"dependencies": {
"@agm/core": "^1.1.0",
"@angular/animations": "~9.1.3",
"@angular/cdk": "^9.2.1",
"@angular/common": "~9.1.3",
"@angular/compiler": "~9.1.3",
"@angular/core": "~9.1.3",
"@angular/fire": "^6.0.0",
"@angular/forms": "~9.1.3",
"@angular/localize": "^9.1.4",
"@angular/material": "^9.2.1",
"@angular/platform-browser": "~9.1.3",
"@angular/platform-browser-dynamic": "~9.1.3",
"@angular/platform-server": "~9.1.3",
"@angular/router": "~9.1.3",
"@firebase/firestore": "^1.14.2",
"@nestjs/common": "^6.0.0",
"@nestjs/core": "^6.0.0",
"@nestjs/ng-universal": "^3.1.0",
"@nestjs/platform-express": "^6.0.0",
"@nguniversal/express-engine": "^9.0.2",
"bootstrap": "^4.4.1",
"class-transformer": "^0.2.3",
"class-validator": "^0.9.1",
"express": "^4.15.2",
"firebase": "^7.14.2",
"geofirex": "^0.1.0",
"reflect-metadata": "^0.1.13",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.3",
"@angular/cli": "~9.1.3",
"@angular/compiler-cli": "~9.1.3",
"@angular/language-service": "~9.1.3",
"@nguniversal/builders": "^9.0.2",
"@types/express": "^4.17.0",
"@types/node": "^12.11.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.8.3"
}
}
Any idea on a workaround for those without WSL?
Edit:
Created true.bat in my PATH with the contents of
@echo off
VER>NUL
seems to resolve it for me on Windows 10 64bit.
Taken from https://stackoverflow.com/a/47318952
Just upgraded @angular/fire from 6.0.0 to 6.0.1, it worked for me
Most helpful comment
Ah sorry about that. It鈥檚 shelling out to a Unix true to capture the failure. I鈥檒l make that more robust & test in my Windows machine. Thanks!