Reputation: 173
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/[email protected] 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 [email protected]: 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"
}
}
Upvotes: 2
Views: 7342
Reputation: 29
solution: just downgrade node version to older like v12.18.0 this work for me
Upvotes: 2