I am getting error while running ng new command
below error is fired during the ng new Project-Name-Here
Could not resolve dependency:
error peer jasmine-core#">=3.7.1" from karma-jasmine-html-reporter#1.6.0
silly fetch manifest jasmine-core#>=3.7.1
83 timing idealTree Completed in 8839ms
84 timing command:install Completed in 8849ms
85 verbose stack Error: unable to resolve dependency tree
85 verbose stack at Arborist.[failPeerConflict] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:1141:25)
85 verbose stack at Arborist.[loadPeerSet] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:1118:34)
85 verbose stack at async Arborist.[buildDepStep] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:836:11)
85 verbose stack at async Arborist.buildIdealTree (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:209:7)
85 verbose stack at async Promise.all (index 1)
85 verbose stack at async Arborist.reify (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\reify.js:130:5)
85 verbose stack at async install (C:\Program Files\nodejs\node_modules\npm\lib\install.js:38:3)
86 verbose cwd C:\Users\PYH0JFQ\source\Hospital\Patient
87 verbose Windows_NT 10.0.19041
88 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--quiet"
89 verbose node v15.11.0
90 verbose npm v7.6.0
91 error code ERESOLVE
92 error ERESOLVE unable to resolve dependency tree
93 error
94 error While resolving: patient#0.0.0
94 error Found: jasmine-core#3.6.0
94 error node_modules/jasmine-core
94 error dev jasmine-core#"~3.6.0" from the root project
94 error
94 error Could not resolve dependency:
94 error peer jasmine-core#">=3.7.1" from karma-jasmine-html-reporter#1.6.0
94 error node_modules/karma-jasmine-html-reporter
94 error dev karma-jasmine-html-reporter#"^1.5.0" from the root project
94 error
94 error Fix the upstream dependency conflict, or retry
94 error this command with --force, or --legacy-peer-deps
94 error to accept an incorrect (and potentially broken) dependency resolution.
I have faced the same issue recently and i got to know this from an online instructor.
you should have phrase the question neatly, anyways
This error is caused by an npm 7 issue. The Angular team recommends to use npm 6 for now.
so downgrade the npm 7 to npm 6 for now
npm install -g npm#6
or
An alternative can be to run ng new with the --skipInstall flag, and then install the dependencies with npm install --legacy-peer-deps.
I found, what I feel is, a better solution.
After running the ng new - go into package.json and simply change
"jasmine-core": "~3.7.0",
to
"jasmine-core": "~3.8.0",
and then run npm install afterwards.
Related
I am trying to install a package tree-sitter-cli using the latest npm
❯ npm -v
8.6.0
But keep getting the following error.
63 timing command:i Completed in 885ms
64 verbose stack Error: command failedche/_logs/2022-04-04T12_58_29_622Z-debug-0.log
64 verbose stack at ChildProcess.<anonymous> (~/.local/lib/node_modules/npm/node_
modules/#npmcli/promise-spawn/index.js:64:27)
64 verbose stack at ChildProcess.emit (node:events:527:28)
64 verbose stack at maybeClose (node:internal/child_process:1090:16)
64 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
65 verbose pkgid tree-sitter-cli#0.20.6
66 verbose cwd /glb/home/innnei
67 verbose Linux 3.10.0-1160.53.1.el7.x86_64
68 verbose node v17.8.0
69 verbose npm v8.6.0
70 error code 1
71 error path ~/.local/lib/node_modules/tree-sitter-cli
72 error command failed
73 error command sh -c node install.js
74 error Downloading https://github.com/tree-sitter/tree-sitter/releases/download/v0.20.6/tree-sitter-linux-x64.gz
75 error node:events:505
75 error throw er; // Unhandled 'error' event
75 error ^
75 error
75 error Error: read ECONNRESET
75 error at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
75 error Emitted 'error' event on ClientRequest instance at:
75 error at TLSSocket.socketErrorListener (node:_http_client:454:9)
75 error at TLSSocket.emit (node:events:527:28)
75 error at emitErrorNT (node:internal/streams/destroy:164:8)
75 error at emitErrorCloseNT (node:internal/streams/destroy:129:3)
75 error at processTicksAndRejections (node:internal/process/task_queues:83:21) {
75 error errno: -104,
75 error code: 'ECONNRESET',
75 error syscall: 'read'
75 error }
75 error
75 error Node.js v17.8.0
76 verbose exit 1
77 timing npm Completed in 1349ms
78 verbose unfinished npm timer reify 1649077110082
79 verbose unfinished npm timer reify:audit 1649077110203
80 verbose unfinished npm timer auditReport:getReport 1649077110203
81 verbose unfinished npm timer reify:build 1649077110257
82 verbose unfinished npm timer build 1649077110257
83 verbose unfinished npm timer build:deps 1649077110257
84 verbose unfinished npm timer build:run:install 1649077110261
85 verbose unfinished npm timer build:run:install:node_modules/tree-sitter-cli 1649077110262
86 verbose code 1
I am behind a corporate proxy (proxy setting is set through shell variables http_proxy & https_proxy ) and npm is working with the proxy settings
❯ npm ping
npm notice PING https://registry.npmjs.org/
npm notice PONG 819ms
This (node & npm) is not really my area of expertise, so I need help in understanding & diagnosing the error.
My npm config is
cache = "~/.local/npmcache"
registry = "https://registry.npmjs.org/"
; "cli" config from command line options
global = true
; node bin location = ~/.local/bin/node
; cwd = $HOME/innnei
; HOME = $HOME/innnei
; Run `npm config ls -l` to show all defaults.
The problem happens when I tried to create a new app using npx create-react-app test-app
after some tries the problem got solved with this command.
npx clear-npx-cache
then after closing the visual studio code editor so that it releases some caches too.
this trick is from this answer
Give it a try.
I cannot install firebase via npm install -g firebase.
I receive the following error that I could not find a solution for:
The issue seem to be relatedd to core-js & protobufjs which cannot be postinstall.
Note: I did reinstall node.js multiple times already - without any luck.
51 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 374ms
52 timing auditReport:getReport Completed in 377ms
53 silly audit report {}
54 timing auditReport:init Completed in 0ms
55 timing reify:audit Completed in 377ms
56 timing reifyNode:node_modules/#firebase/polyfill/node_modules/core-js Completed in 1368ms
57 timing reifyNode:node_modules/core-js Completed in 1470ms
58 timing reify:unpack Completed in 1470ms
59 timing reify:unretire Completed in 0ms
60 timing build:queue Completed in 1ms
61 info run core-js#3.18.1 postinstall node_modules/core-js node -e "try{require('./postinstall')}catch(e){}"
62 info run core-js#3.6.5 postinstall node_modules/#firebase/polyfill/node_modules/core-js node -e "try{require('./postinstall')}catch(e){}"
63 info run core-js#3.18.1 postinstall { code: 127, signal: null }
64 info run core-js#3.6.5 postinstall { code: 127, signal: null }
65 timing reify:rollback:createSparse Completed in 338ms
66 timing reify:rollback:retireShallow Completed in 31ms
67 timing command:install Completed in 2501ms
68 verbose stack Error: command failed
68 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs2\node_modules\npm\node_modules\#npmcli\promise-spawn\index.js:64:27)
68 verbose stack at ChildProcess.emit (node:events:390:28)
68 verbose stack at maybeClose (node:internal/child_process:1064:16)
68 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
69 verbose pkgid core-js#3.18.1
70 verbose cwd C:\Users\chmit_000
71 verbose Windows_NT 10.0.19042
72 verbose argv "C:\\Program Files\\nodejs2\\node.exe" "C:\\Program Files\\nodejs2\\node_modules\\npm\\bin\\npm-cli.js" "install" "core-js"
73 verbose node v16.10.0
74 verbose npm v7.24.0
75 error code 127
76 error path C:\Users\chmit_000\node_modules\core-js
77 error command failed
78 error command bash -c node -e "try{require('./postinstall')}catch(e){}"
79 error /bin/bash: node: command not found
80 verbose exit 127
The package meant for global installation is firebase-tools. That's the CLI used for deploying your app (or parts of it) to firebase, as well as performing other administrative tasks. The firebase package is the library used for accessing firebase backend/cloud functions in a web/mobile project.
If you're looking to install the CLI, run npm install -g firebase-tools.
Here are links to both packages:
firebase
firebase-tools
I keep getting this error in Git Bash when trying to do an npm install:
64 verbose stack Error: command failed
64 verbose stack at ChildProcess.<anonymous> (C:\Users\baseuser\AppData\Roaming\npm\node_modules\npm\node_modules\#npmcli\promise-spawn\index.js:64:27)
64 verbose stack at ChildProcess.emit (events.js:400:28)
64 verbose stack at maybeClose (internal/child_process.js:1058:16)
64 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
65 verbose pkgid app-backend#1.0.1-dev.0
66 verbose cwd C:\work\gitrepo\app-backend
67 verbose Windows_NT 10.0.18363
68 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\baseuser\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
69 verbose node v14.18.0
70 verbose npm v8.0.0
71 error code 1
72 error path C:\work\gitrepo\app-backend
73 error command failed
74 error command C:\windows\system32\cmd.exe /d /s /c npm run build
75 verbose exit 1
I have node and npm installed globally and npm install works in Powershell or Windows Command line, but not in Git Bash for some reason. I have them added to PATH variable. I done npm clear cache -force but nothing changed.
Removed node, npm, git with git bash and reinstalled them againt, and the error still present.
this issue happened recently to many ppl earlier in the last 2 weeks , it seems like a problem withh package distrepution .
To fix this try cloning your library to different location . going into the packages/dscc-scripts directory and running the build command. You can then point all of the scripts from the package.json dscc-gen made to the packages/dscc-scripts/index.js file. Bit of a hack, but good for the quick fix.
I am running the following command (windows) (npm v7.0.0-beta.8) (node v12.18.1)
ng new light-webapp
It throws the following error
...
CREATE light-webapp/e2e/tsconfig.json (299 bytes)
CREATE light-webapp/e2e/src/app.e2e-spec.ts (645 bytes)
CREATE light-webapp/e2e/src/app.po.ts (301 bytes)
| Installing packages...npm ERR! code ERESOLVE
npm ERR! unable to resolve dependency tree
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\...\AppData\Local\npm-cache\_logs\2021-05-15T14_51_21_350Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.
The above mentioned error log shows the following:
...
1899 timing idealTree:node_modules/karma-jasmine Completed in 0ms
1900 silly placeDep jasmine-core#>=3.7.1 Symbol(CONFLICT) for: karma-jasmine-html-reporter#1.6.0
1901 timing idealTree Completed in 15783ms
1902 timing command:install Completed in 15789ms
1903 verbose type peer
1904 verbose stack Error: unable to resolve dependency tree
1904 verbose stack at Arborist.[placeDep] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:814:27)
1904 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:631:46
1904 verbose stack at Array.map (<anonymous>)
1904 verbose stack at Arborist.[buildDepStep] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:631:8)
1904 verbose stack at async Arborist.buildIdealTree (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:166:7)
1904 verbose stack at async Promise.all (index 1)
1904 verbose stack at async Arborist.reify (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\reify.js:125:5)
1904 verbose stack at async install (C:\Program Files\nodejs\node_modules\npm\lib\install.js:40:5)
1905 verbose cwd C:\Users\...\VisualStudioCodeWorkspace\light-webapp
1906 verbose Windows_NT 10.0.18363
1907 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--quiet"
1908 verbose node v12.18.1
1909 verbose npm v7.0.0-beta.8
1910 error code ERESOLVE
1911 error unable to resolve dependency tree
Any ideas why node is failing on such a simple command?
Installing the latest versions of node and npm separately solved my issue.
I try running 'npm outdated' from the console in my node project. But I get this error:
npm ERR! Cannot read property 'length' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2019-03-31T12_26_30_745Z-debug.log
This is the error in the log:
199 verbose stack TypeError: Cannot read property 'length' of undefined
199 verbose stack at dotindex (C:\Users\amita\AppData\Roaming\npm\node_modules\npm\node_modules\text-table\index.js:59:32)
199 verbose stack at C:\Users\amita\AppData\Roaming\npm\node_modules\npm\node_modules\text-table\index.js:11:21
199 verbose stack at Array.forEach (<anonymous>)
199 verbose stack at forEach (C:\Users\amita\AppData\Roaming\npm\node_modules\npm\node_modules\text-table\index.js:73:31)
199 verbose stack at C:\Users\amita\AppData\Roaming\npm\node_modules\npm\node_modules\text-table\index.js:10:9
199 verbose stack at Array.reduce (<anonymous>)
199 verbose stack at reduce (C:\Users\amita\AppData\Roaming\npm\node_modules\npm\node_modules\text-table\index.js:63:30)
199 verbose stack at module.exports (C:\Users\amita\AppData\Roaming\npm\node_modules\npm\node_modules\text-table\index.js:9:20)
199 verbose stack at C:\Users\amita\AppData\Roaming\npm\node_modules\npm\lib\outdated.js:130:16
199 verbose stack at cb (C:\Users\amita\AppData\Roaming\npm\node_modules\npm\node_modules\slide\lib\async-map.js:47:24)
199 verbose stack at outdated_ (C:\Users\amita\AppData\Roaming\npm\node_modules\npm\lib\outdated.js:221:12)
199 verbose stack at skip (C:\Users\amita\AppData\Roaming\npm\node_modules\npm\lib\outdated.js:343:5)
199 verbose stack at updateDeps (C:\Users\amita\AppData\Roaming\npm\node_modules\npm\lib\outdated.js:446:7)
199 verbose stack at tryCatcher (C:\Users\amita\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
199 verbose stack at Promise.successAdapter [as _fulfillmentHandler0] (C:\Users\amita\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\nodeify.js:23:30)
199 verbose stack at Promise._settlePromise (C:\Users\amita\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:566:21)
200 verbose cwd C:\Users\amita\Ionic\toratlechima
201 verbose Windows_NT 10.0.17134
202 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\amita\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "outdated"
203 verbose node v10.11.0
204 verbose npm v6.9.0
205 error Cannot read property 'length' of undefined
206 verbose exit [ 1, true ]
This also happens when I try to run it globally.
Anyone encounter this?
Appears to be fixed in the next release, which isn't out yet.
https://github.com/npm/cli/pull/173
You can install the pre-release to fix it.
npm -g i npm#next
Update
NPM 6.9.2 is out
npm install -g npm
There is a bug in the npm, but you can easily fix it:
Go to your npm folder (i.e. /usr/local/lib/node_modules) and find a outdated.js file (i.e. /usr/local/lib/node_modules/npm/lib/outdated.js for Mac or C:\Users\YOUR_USER_NAME\AppData\Roaming\npm\node_modules\npm\lib\outdated.js for Windows)
Find a function makePretty and change
deppath
to
deppath || 'global'
in my case it was line #152
I hope it helps! 🙂
You can also try npm upgrade -g. Worked for me.
Here's how I successfully fixed the error after checking 'global' was in outdated.js file. Without any other requirements like brew etc, (type these commands in the terminal):
sudo npm cache clean -f (force) clear you npm cache
sudo npm install -g n install n (this might take a while)
sudo n stable upgrade to the current stable version
npm upgrade -g upgrade npm
Note that sudo might prompt your password.