I've been searching some queations to solve a problem installing the ng-bootstrap but i can solve it
I have w10, VSCode 1.65.2, angular version:
Angular CLI: 13.2.3
Node: 16.14.2
Package Manager: npm 8.5.3
OS: win32 x64
Angular: undefined
...
Package Version
------------------------------------------------------
#angular-devkit/architect 0.1302.3
#angular-devkit/core 13.2.3
#angular-devkit/schematics 13.2.3
#angular/cli 13.2.3
#schematics/angular 13.2.3
I've open a cmd terminal into vsc and type ng add #ng-bootstrap/ng-bootstrap as instalation said, but I can do it. This is my error
Skipping installation: Package already installed
UPDATE package.json (1327 bytes)
⠸ Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: angular-firebase#0.0.0
npm ERR! Found: #angular/compiler#13.2.6
npm ERR! node_modules/#angular/compiler
npm ERR! #angular/compiler#"~13.2.0" from the root project
npm ERR! peer #angular/compiler#"13.2.6" from #angular/compiler-cli#13.2.6
npm ERR! node_modules/#angular/compiler-cli
npm ERR! dev #angular/compiler-cli#"~13.2.0" from the root project
npm ERR! peer #angular/compiler-cli#"^13.0.0" from #angular-devkit/build-angular#13.2.6
npm ERR! node_modules/#angular-devkit/build-angular
npm ERR! dev #angular-devkit/build-angular#"~13.2.3" from the root project
npm ERR! 1 more (#ngtools/webpack)
npm ERR! 1 more (#angular/platform-browser-dynamic)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! #angular/localize#"~13.2.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #angular/compiler#13.2.7
npm ERR! node_modules/#angular/compiler
npm ERR! peer #angular/compiler#"13.2.7" from #angular/localize#13.2.7
npm ERR! node_modules/#angular/localize
npm ERR! #angular/localize#"~13.2.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\pcb\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\pcb\AppData\Local\npm-cache\_logs\2022-03-18T12_03_16_626Z-debug-0.log
✖ Package install failed, see above.
The Schematic workflow failed. See above.
And finally this is my jsom
{ "name": "angular-firebase",
"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": "~13.2.0",
"#angular/common": "~13.2.0",
"#angular/compiler": "~13.2.0",
"#angular/core": "~13.2.0",
"#angular/fire": "^7.2.1",
"#angular/forms": "~13.2.0",
"#angular/localize": "~13.2.0",
"#angular/platform-browser": "~13.2.0",
"#angular/platform-browser-dynamic": "~13.2.0",
"#angular/router": "~13.2.0",
"#ng-bootstrap/ng-bootstrap": "^12.0.0",
"#popperjs/core": "^2.10.2",
"#sweetalert2/ngx-sweetalert2": "^11.0.0",
"bootstrap": "^5.1.3",
"rxjs": "~7.5.0",
"sweetalert2": "^11.4.4",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "~13.2.3",
"#angular/cli": "^13.3.0",
"#angular/compiler-cli": "~13.2.0",
"#types/jasmine": "~3.10.0",
"#types/node": "^12.11.1",
"jasmine-core": "~4.0.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.1.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.5.2"
}
}
Could you help me and leave the instuctions as i were stupid (step by step)
Kind regards
PaCaBo
Remove your node_modules folder and package-lock.json file. After follow the steps,
Run
npm install --save #ng-bootstrap/ng-bootstrap
then
npm install
Related
I'm trying to host an Angular application for a customer, but I can't get it to run on Linux. The customer develops on Windows and it works for him. I am using NodeJS 19.
Error message when npm install:
npm notice
npm notice New minor version of npm available! 9.2.0 -> 9.3.1
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.3.1>
npm notice Run `npm install -g npm#9.3.1` to update!
npm notice
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #agm/core#3.0.0-beta.0
npm ERR! Found: #angular/common#14.2.12
npm ERR! node_modules/#angular/common
npm ERR! #angular/common#"^14.2.0" from the root project
npm ERR! peer #angular/common#"^14.0.0 || ^15.0.0" from #angular/cdk#14.2.7
npm ERR! node_modules/#angular/cdk
npm ERR! #angular/cdk#"^14.2.4" from the root project
npm ERR! peer #angular/cdk#"14.2.7" from #angular/material#14.2.7
npm ERR! node_modules/#angular/material
npm ERR! #angular/material#"^14.2.4" from the root project
npm ERR! 1 more (#angular/material-moment-adapter)
npm ERR! 5 more (#angular/forms, #angular/material, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/common#"^9.1.0 || ^10.0.0" from #agm/core#3.0.0-beta.0
npm ERR! node_modules/#agm/core
npm ERR! #agm/core#"^3.0.0-beta.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #angular/common#10.2.5
npm ERR! node_modules/#angular/common
npm ERR! peer #angular/common#"^9.1.0 || ^10.0.0" from #agm/core#3.0.0-beta.0
npm ERR! node_modules/#agm/core
npm ERR! #agm/core#"^3.0.0-beta.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
package.json
{
"name": "web-app",
"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": {
"#agm/core": "^3.0.0-beta.0",
"#angular/animations": "^14.2.0",
"#angular/cdk": "^14.2.4",
"#angular/common": "^14.2.0",
"#angular/compiler": "^14.2.0",
"#angular/core": "^14.2.0",
"#angular/forms": "^14.2.10",
"#angular/material": "^14.2.4",
"#angular/material-moment-adapter": "^14.2.5",
"#angular/platform-browser": "^14.2.10",
"#angular/platform-browser-dynamic": "^14.2.0",
"#angular/router": "^14.2.10",
"#manekinekko/angular-web-bluetooth": "^11.2.2",
"#types/googlemaps": "^3.39.13",
"#types/maplibre-gl": "^1.14.0",
"#types/web-bluetooth": "^0.0.16",
"bootstrap": "^3.4.1",
"maplibre-gl": "^1.15.3",
"moment": "^2.29.4",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^14.2.2",
"#angular/cli": "~14.2.2",
"#angular/compiler-cli": "^14.2.0",
"#types/geojson": "^7946.0.10",
"#types/jasmine": "~4.0.0",
"jasmine-core": "~4.3.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.7.2"
}
}
I have already tried --force and --legacy-peer-deps but it still doesn't work.
A couple of things here.
First one of the packages you're using doesn't like the version of Angular you're using.
#agm/core#3.0.0-beta.0
This says that #agm/core#3.0.0-beta.0 is made for angular 9-10 and you're running 14.
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/common#"^9.1.0 || ^10.0.0" from #agm/core#3.0.0-beta.0
npm ERR! node_modules/#agm/core
npm ERR! #agm/core#"^3.0.0-beta.0" from the root project
If you MUST use this version of #agm/core#3.0.0-beta.0 then you can run:
npm install --legacy-peer-deps
But this is not best practice. It's better to look for a version that works with your Angular version. A quick look at that package (npm view #agm/core versions --json) shows me that you have the latest version, since it's dependency is Angular 9-10 you might want to look for a replacement library that works with your version of Angular.
Second, you are using a development version of node, meaning that 19 is the latest but not considered stable by node.js- odd numbers for development, even numbers for production, current stable version is 18.13.0:
https://nodejs.org/en/download/
If you want to use multiple versions of node, you can use nvm (Node version manager)
Your version of node.js needs to match the installation version of node.js - so the Windows machine and the Linux machine need to both have the same version of node.js - that might be why it works in one place and not the other.
Angular CLI: 14.2.3
Node: 16.15.1
Package Manager: npm 8.12.1
OS: darwin x64
I am installing angular bootstrap (trying to) getting the following error from NPM
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: tractapp#0.0.0
npm ERR! Found: #angular/core#14.2.2
npm ERR! node_modules/#angular/core
npm ERR! peer #angular/core#"14.2.2" from #angular/animations#14.2.2
npm ERR! node_modules/#angular/animations
npm ERR! peer #angular/animations#"^14.0.0 || ^15.0.0" from #angular/material#14.2.2
npm ERR! node_modules/#angular/material
npm ERR! #angular/material#"^14.2.2" from the root project
npm ERR! peerOptional #angular/animations#"14.2.2" from #angular/platform-browser#14.2.2
npm ERR! node_modules/#angular/platform-browser
npm ERR! peer #angular/platform-browser#"^12.0.0 || ^13.0.0 || ^14.0.0" from #angular/fire#7.4.1
npm ERR! node_modules/#angular/fire
npm ERR! #angular/fire#"^7.4.1" from the root project
npm ERR! 6 more (#angular/forms, #angular/material, ...)
npm ERR! 2 more (#swimlane/ngx-charts, the root project)
npm ERR! peer #angular/core#"^14.0.0 || ^15.0.0" from #angular/cdk#14.2.2
npm ERR! node_modules/#angular/cdk
npm ERR! peer #angular/cdk#"14.2.2" from #angular/material#14.2.2
npm ERR! node_modules/#angular/material
npm ERR! #angular/material#"^14.2.2" from the root project
npm ERR! peer #angular/cdk#">=12.0.0" from #swimlane/ngx-charts#20.1.0
npm ERR! node_modules/#swimlane/ngx-charts
npm ERR! #swimlane/ngx-charts#"^20.1.0" from the root project
npm ERR! 2 more (ng2-charts, the root project)
npm ERR! 16 more (#angular/common, #angular/compiler, #angular/fire, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! #ng-bootstrap/ng-bootstrap#"13.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #angular/core#14.2.6
npm ERR! node_modules/#angular/core
npm ERR! peer #angular/core#"14.2.6" from #angular/forms#14.2.6
npm ERR! node_modules/#angular/forms
npm ERR! #angular/forms#"^14.2.0" from the root project
npm ERR! peer #angular/forms#"^14.1.0" from #ng-bootstrap/ng-bootstrap#13.0.0
npm ERR! node_modules/#ng-bootstrap/ng-bootstrap
npm ERR! #ng-bootstrap/ng-bootstrap#"13.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
NPM errors and how these are stated is not my strong suit of understanding, would love if someone could help me out and point me in the right direction here.
Thanks!
Heres my package.json file aswell, im assuming its something in there by the way the error is formed/stated.
{
"name": "tractapp",
"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": "^14.2.0",
"#angular/cdk": "^14.2.2",
"#angular/common": "^14.2.0",
"#angular/compiler": "^14.2.0",
"#angular/core": "^14.2.0",
"#angular/fire": "^7.4.1",
"#angular/forms": "^14.2.0",
"#angular/material": "^14.2.2",
"#angular/platform-browser": "^14.2.0",
"#angular/platform-browser-dynamic": "^14.2.0",
"#angular/router": "^14.2.0",
"#fortawesome/angular-fontawesome": "^0.11.1",
"#fortawesome/fontawesome-svg-core": "^6.2.0",
"#fortawesome/free-solid-svg-icons": "^6.2.0",
"#stripe/stripe-js": "^1.37.0",
"#sweetalert2/ngx-sweetalert2": "^12.0.1",
"#swimlane/ngx-charts": "^20.1.0",
"aos": "^2.3.4",
"apexcharts": "^3.35.5",
"chart.js": "^3.9.1",
"ng-apexcharts": "^1.7.1",
"ng2-charts": "^4.0.1",
"ngx-print": "^1.2.1",
"ngx-stripe": "^14.1.0",
"rxjs": "~7.5.0",
"stripe": "^10.11.0",
"sweetalert2": "^11.5.1",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^14.2.3",
"#angular/cli": "~14.2.3",
"#angular/compiler-cli": "^14.2.0",
"#types/d3": "^7.4.0",
"#types/jasmine": "~4.0.0",
"jasmine-core": "~4.3.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.7.2"
}
}
Moving the comment to an answer per OP's request and so that the question can be marked resolved.
Looking at the Github releases page (accessed on 10/12/22 for v 13.0.0) the maximum support for the library currently is Angular 14.1, where as you are using 14.2.2. This seems to be a version compatibility issue (essentially the library is trying to pull an older version of Angular and you are getting a conflict)
You either have to downgrade you Angular version or use something else
npm update was perfect to me :D
Run npm update before installing ng bootstrap in your vs code terminal, that will fix it
I had the same problem when I added #angular/service-worker to my ionic project.
The angular version required by #angular/service-worker is different from the version installed at the beginning, and they conflict.
package-lock.json retains the version of angular that was originally installed
So, you can try to delete package-lock.json and rerun npm install
I get this error when I try to upgrade to Angular 8.
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an
old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from
the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: comprehensivedashboard#0.0.0
npm ERR! Found: #angular/animations#7.2.6
npm ERR! node_modules/#angular/animations
npm ERR! #angular/animations#"~8.2.14" from the root project
npm ERR! peer #angular/animations#">=7.0.0" from
#angular/material#7.3.3
npm ERR! node_modules/#angular/material
npm ERR! #angular/material#"~8.2.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! #angular/animations#"~8.2.14" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #angular/core#8.2.14
npm ERR! node_modules/#angular/core
npm ERR! peer #angular/core#"8.2.14" from #angular/animations#8.2.14
npm ERR! node_modules/#angular/animations
npm ERR! #angular/animations#"~8.2.14" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency
resolution.
npm ERR!
npm ERR! See
C:\Users\vakkinen\AppData\Local\npm-cache\eresolve-report.txt for a
full report.
npm ERR! A complete log of this run can be found in:
npm ERR!
C:\Users\vakkinen\AppData\Local\npm-cache_logs\2021-10-05T12_19_50_257Z-debug.log
So decided to create a brand new Angular8 app and see what the package.json file looks like. That file is attached below. Then I added all the packages I need to this brand new empty project one at a time. The application build succeeded and I was able to run the application. So I copied and pasted all the dependencies and devDependencies to the old project package.json. That project still fails npm i because of the same error above. So I tried to clone the repo into a new directory and replaced the contents of the package.json with the contents of the package.json from the brand new empty project, still the same error. What am I doing wrong ?
{
"name": "dashboard",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "~8.2.14",
"#angular/cdk": "8.2.3",
"#angular/common": "~8.2.14",
"#angular/compiler": "~8.2.14",
"#angular/core": "~8.2.14",
"#angular/forms": "~8.2.14",
"#angular/material": "~8.2.3",
"#angular/platform-browser": "~8.2.14",
"#angular/platform-browser-dynamic": "~8.2.14",
"#angular/router": "~8.2.14",
"#ng-bootstrap/ng-bootstrap": "^5.3.0",
"bootstrap": "^4.3.1",
"core-js": "^2.5.4",
"#swimlane/ngx-charts": "^11.0.0",
"fusioncharts": "^3.15.0-sr.1",
"hammerjs": "^2.0.8",
"moment": "^2.24.0",
"ngx-bootstrap": "^3.2.0",
"ngx-csv": "^0.3.1",
"ngx-export-as": "1.4.2",
"ngx-scrollbar": "^4.1.1",
"ngx-select-dropdown": "^1.0.1",
"node-sass": "^4.14.0",
"rxjs": "~6.4.0",
"sass-loader": "^8.0.2",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"#angular-devkit/build-angular": "~0.13.0",
"#angular/cli": "~8.3.29",
"#angular/compiler-cli": "~8.2.14",
"#angular/language-service": "~8.2.14",
"#types/jasmine": "~3.3.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.7.0",
"protractor": "~7.0.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.5.3"
}
}
There should be a file called package-lock in the same folder as the package file. Delete it and the error should go away. The package-lock file contains all dependencies of your dependencies and their versions. Deleting it doesn’t affect your project since it’s regenerated on npm install.
The error message warns you that the package-lock.json file is the issue. Just delete it and a new one will be generated.
The issue stems from having incorrect files in the node_modules directory and the package-lock.json.
Most probably the easiest solution is to delete both the node_modules directory and the package-lock.json and then running a npm install to get a clean node_modules directory and a new package-lock.json according to your package.json
I recommend reading more about what the package-lock.json file is for here: https://medium.com/coinmonks/everything-you-wanted-to-know-about-package-lock-json-b81911aa8ab8
Steps to fix this issue:
Delete node_modules folder.
Delete package-lock.json.
Run npm i --force.
I am new to node and npm and am trying to setup my system with node and npm so that I can run a local project. After installing the latest version of node and npm, when I run the command npm install --legacy-peer-deps, I see the following error:
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /Users/<username>/.nvm/versions/node/v14.17.6/bin/node /Users/<username>/.nvm/versions/node/v14.17.6/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/<username>/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! > #types/ramda#0.25.0 prepublish
npm ERR! > yarn run build
npm ERR!
npm ERR! yarn run v1.19.1
npm ERR! $ gulp build
npm ERR! [08:21:10] Requiring external module ts-node/register
npm ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated core-js#2.5.0: core-js#<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! gulp[17622]: ../src/node_contextify.cc:681:static void node::contextify::ContextifyScript::New(const FunctionCallbackInfo<v8::Value> &): Assertion `args[1]->IsString()' failed.
npm ERR! 1: 0x101306bb5 node::Abort() (.cold.1) [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! 2: 0x1000ad6c9 node::Abort() [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! 3: 0x1000ad531 node::Assert(node::AssertionInfo const&) [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! 4: 0x1000a0d14 node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! 5: 0x1002624a8 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! 6: 0x10026175c v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! 7: 0x10026117f v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! 8: 0x100a7c4d9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! 9: 0x100a11401 Builtins_JSBuiltinsConstructStub [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! 10: 0x100afa783 Builtins_ConstructHandler [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! 11: 0x100a15282 Builtins_InterpreterEntryTrampoline [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! 12: 0x100a15282 Builtins_InterpreterEntryTrampoline [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! 13: 0x100a15282 Builtins_InterpreterEntryTrampoline [/Users/<username>/.nvm/versions/node/v14.17.6/bin/node]
npm ERR! error Command failed with signal "SIGABRT".
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/<username>/.npm/_cacache/tmp/git-cloneAPu0nz
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c yarn run build
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! /Users/<username>/.npm/_logs/2021-09-07T15_21_10_861Z-debug.log
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/<username>/.npm/_logs/2021-09-07T15_21_29_362Z-debug.log
node -v ==> v14.17.6
npm -v ==> 7.22.0
I ran npm cache clean -f and tried npm install --force but still run into the same error. Can anyone help me figure out what this error is and what I can try to do to resolve it? I did try the steps mentioned in this previous answer but it did not help me.
Contents of package.json
{
"name": "jit-ui",
"version": "0.0.1",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build-prod": "ng build --prod --source-map",
"build-dev": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "^12.2.4",
"#angular/cdk": "^12.2.4",
"#angular/common": "~12.2.4",
"#angular/compiler": "~12.2.4",
"#angular/core": "~12.2.4",
"#angular/flex-layout": "^12.0.0-beta.34",
"#angular/forms": "~12.2.4",
"#angular/material": "^12.2.4",
"#angular/platform-browser": "~12.2.4",
"#angular/platform-browser-dynamic": "~12.2.4",
"#angular/router": "^12.2.4",
"#uirouter/angular": "^8.0.1",
"core-js": "^3.17.2",
"hammerjs": "^2.0.8",
"moment": "^2.29.1",
"ngx-perfect-scrollbar": "^10.1.1",
"ramda": "^0.27.1",
"rxjs": "~7.3.0",
"rxjs-compat": "^6.6.7",
"tslib": "^2.3.1",
"zone.js": "^0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^12.2.4",
"#angular-devkit/core": "~12.2.4",
"#angular/cli": "~12.2.4",
"#angular/compiler-cli": "~12.2.4",
"#angular/language-service": "~12.2.4",
"#types/jasmine": "^3.9.0",
"#types/jasminewd2": "~2.0.10",
"#types/node": "~16.7.13",
"#types/ramda": "github:types/npm-ramda",
"codelyzer": "~6.0.2",
"jasmine-core": "~3.9.0",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.3.4",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.7.0",
"prettier": "^2.3.2",
"protractor": "^7.0.0",
"ts-node": "~10.2.1",
"tslint": "~5.20.1",
"typescript": "~4.4"
}
}
solution: just downgrade node version to older like v12.18.0 this work for me
I am using Angular 5 ,bit-bucket ,azure app service and I have setup continuous integration with bit-bucket and Azure deployment option.
Please find following details
Project structure
My package.json
{
"name": "vaquarkhana-poc-app",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build –prod ",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "npm run build"
},
"engines": {
"node": ">=10.0.0",
"npm": ">=6.0.0"
},
"private": true,
"dependencies": {
"#angular/animations": "^5.2.10",
"#angular/cdk": "^5.2.5",
"#angular/common": "^5.2.0",
"#angular/compiler": "^5.2.0",
"#angular/core": "^5.2.0",
"#angular/flex-layout": "^5.0.0-beta.14",
"#angular/forms": "^5.2.0",
"#angular/http": "^5.2.0",
"#angular/material": "^5.2.5",
"#angular/platform-browser": "^5.2.0",
"#angular/platform-browser-dynamic": "^5.2.0",
"#angular/router": "^5.2.0",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
},
"devDependencies": {
"#angular/cli": "~1.7.4",
"#angular/compiler-cli": "^5.2.0",
"#angular/language-service": "^5.2.0",
"#types/jasmine": "~2.8.3",
"#types/jasminewd2": "~2.0.2",
"#types/node": "~6.0.60",
"angular-ide": "^0.9.41",
"codelyzer": "^4.0.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",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
}
}
Question : I don't want to add any build dependency folder into bit-bucket like
node_modules
dist
Since Azure build package.json during continuous integration however my build is keep failing during deployment .
Logs :
'ng' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! vaquarkhan-pos-app#0.0.0 build: `ng build –prod `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vaquarkhan-pos-app#0.0.0 build script.
npm ERR! This is most likely a problem with the vaquarkhan-pos-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ng build –prod
npm ERR! You can get their info via:
npm ERR! npm owner ls vaquarkhan-pos-app
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "node" "D:\\Program Files (x86)\\npm\\1.4.28\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! cwd D:\home\site\wwwroot
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vaquarkhan-pos-app#0.0.0 postinstall: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vaquarkhan-pos-app#0.0.0 postinstall 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! D:\local\AppData\npm-cache\_logs\2018-07-21T05_08_50_688Z-debug.log
Failed exitCode=1, command="D:\Program Files (x86)\nodejs\10.6.0\node.exe" "D:\Program Files (x86)\npm\6.1.0\node_modules\npm\bin\npm-cli.js" install --production
An error has occurred during web site deployment.
Invalid start-up command "ng serve" in package.json. Please use the format "node <script relative path>".\r\nMissing server.js/app.js files, web.config is not generated\r\nnpm WARN lifecycle The node binary used for scripts is D:\Program Files (x86)\nodejs\0.10.28\node.exe but npm is using D:\Program Files (x86)\nodejs\10.6.0\node.exe itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.\r\nnpm WARN invalid config loglevel="notice"\r\n'ng' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n\r\nnpm ERR! vaquarkhan-pos-app#0.0.0 build: `ng build �prod `\r\nnpm ERR! Exit status 1\r\nnpm ERR! \r\nnpm ERR! Failed at the vaquarkhan-pos-app#0.0.0 build script.\r\nnpm ERR! This is most likely a problem with the vaquarkhan-pos-app package,\r\nnpm ERR! not with npm itself.\r\nnpm ERR! Tell the author that this fails on your system:\r\nnpm ERR! ng build �prod \r\nnpm ERR! You can get their info via:\r\nnpm ERR! npm owner ls vaquarkhan-pos-app\r\nnpm ERR! There is likely additional logging output above.\r\nnpm ERR! System Windows_NT 6.2.9200\r\nnpm ERR! command "node" "D:\\Program Files (x86)\\npm\\1.4.28\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"\r\nnpm ERR! cwd D:\home\site\wwwroot\r\nnpm ERR! node -v v0.10.40\r\nnpm ERR! npm -v 1.4.28\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! errno 1\r\nnpm ERR! vaquarkhan-pos-app#0.0.0 postinstall: `npm run build`\r\nnpm ERR! Exit status 1\r\nnpm ERR! \r\nnpm ERR! Failed at the vaquarkhan-pos-app#0.0.0 postinstall script.\r\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\r\n\r\nnpm ERR! A complete log of this run can be found in:\r\nnpm ERR! D:\local\AppData\npm-cache\_logs\2018-07-21T05_08_50_688Z-debug.log\r\nD:\Program Files (x86)\SiteExtensions\Kudu\75.10629.3460\bin\Scripts\starter.cmd deploy.cmd
I am wonder if anyone faced same issue and resolved ?
Tow points to fix
I see node -v v0.10.40 in your error message, which is caused by invalid node version in Application settings. Set WEBSITE_NODE_DEFAULT_VERSION to 10.6.0 which is the only version available on Azure that matches your requirement.
Deployment with bitbucket makes your code built by Kudu, which requires your angular related modules in devDependencies to be installed on Kudu as well, need to copy them to dependencies.