I'm trying to deploy an angular app to azure static web apps.
node version = 16.18.1
npm version = 8.8.0
Azure uses gitub actions to build and deploy the code.
When I push the code, github actions starts building the code and fails with this error:
Using Node version:
v16.20.2
Using Npm version:
8.19.4
Running 'npm install'...
npm ERR! Invalid version
How can I fix this? How can I set npm version?
Edit:
On my local, I have to run:
npm install --legacy-peer-deps
Looks like it is failing because of this. Any solution to this?
When I tried to implement the same in my environment, got the same error.
"@angular/core": "^7.0.0"
as Peer dependency in local.Package.json:
In my case, I figured out that I was getting the error because I had
@angular/core
dependency in both dependencies and peer dependencies section with different versions inpackage.json
.@angular/core
in dependencies section and changed the version of@angular/core
to16.0.0
in peer dependencies.(or)
package.json
, later thosedependencies
can be added manually topeer dependencies
:Able to deploy the Angular application to static web app successfully:
Portal:
Running the deployed application: