Can't install material-ui/core for react-native 17.0.1 - react-native

Would anyone be able to clarify as to why this is not installing as it should?
$ npm install #material-ui/core
Here are the logs:
...
29 http fetch GET 304 https://registry.npmjs.org/react 125ms (from cache)
30 timing idealTree Completed in 2086ms
31 timing command:install Completed in 2090ms
32 verbose stack Error: unable to resolve dependency tree
32 verbose stack at Arborist.[failPeerConflict] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:1011:25)
32 verbose stack at Arborist.[loadPeerSet] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:991:36)
36 verbose node v15.0.0
37 verbose npm v7.0.2
38 error code ERESOLVE
39 error ERESOLVE unable to resolve dependency tree
40 error
41 error While resolving: [1mamazon-clone[22m#[1m0.1.0[22m
41 error Found: [1mreact[22m#[1m17.0.1[22m[2m[22m
41 error [2mnode_modules/react[22m
41 error [1mreact[22m#"[1m^17.0.1[22m" from the root project
41 error
41 error Could not resolve dependency:
41 error [35mpeer[39m [1mreact[22m#"[1m^16.8.0[22m" from [1m#material-ui/core[22m#[1m4.11.0[22m[2m[22m
41 error [2mnode_modules/#material-ui/core[22m
41 error [1m#material-ui/core[22m#"[1m*[22m" from the root project
41 error
41 error Fix the upstream dependency conflict, or retry
41 error this command with --force, or --legacy-peer-deps
41 error to accept an incorrect (and potentially broken) dependency resolution.
I got chuncks of the logs above that may tell what exactly is going on.

Looks like this post has your solution:
https://github.com/npm/cli/issues/2000. It looks like a recent issue with an eslint dependency

Related

How to debug and fix npm and yarn connection issues?

I am trying to create a new create-react-app project (yarn create react-app my-app and npm init react-app my-app and npx create-react-app my-app) but it fails with network / connection issues (logs shown below). I have tried a bunch of fixes but nothing works. What else can I try or how can I check if it really is a network issue (how to debug)?
What I've tried:
Successfully run other yarn and npm commands
yarn add axios and npm install axios
Checked .npmrc and it has registry=https://registry.npmjs.org/
Increased yarn's network timeout yarn install --network-timeout 1000000
Reinstalled create react app
npm uninstall -g create-react-app
&& npm install -g create-react-app -d
Checked the proxy settings yarn config get proxy // undefined yarn config get https-proxy // undefined
Made sure my version of npm (9.4.0) supports tls1.2 npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz
If I run yarn create react-app my-app it logs
yarn create v1.22.19
[2/4] 🚚 Fetching packages...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: https://registry.yarnpkg.com/tar/-/tar-2.2.2.tgz: aborted.
This is the output in the bug report
Trace:
Error: aborted
at connResetException (node:internal/errors:718:14)
at TLSSocket.socketCloseListener (node:_http_client:456:19)
at TLSSocket.emit (node:events:525:35)
at node:net:320:12
at TCP.done (node:_tls_wrap:588:7)
If I run npm init create-react-app my-app it logs the following to the console
npm ERR! code ECONNRESET
npm ERR! network aborted
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
This is the output in the bug report
…
385 notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
386 http fetch POST 426 http://registry.npmjs.org/-/npm/v1/security/audits/quick 150ms
387 verbose audit error HttpErrorGeneral: 426 Upgrade Required - POST
387 verbose audit error at async AuditReport.run (/Users/.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/audit-report.js:106:19) {
387 verbose audit error headers: [Object: null prototype] {
387 verbose audit error date: [ 'Fri, 27 Jan 2023 00:52:26 GMT' ],
387 verbose audit error 'content-type': [ 'text/plain' ],
387 verbose audit error 'content-length': [ '271' ],
387 verbose audit error connection: [ 'keep-alive' ],
387 verbose audit error 'npm-notice': [
387 verbose audit error 'Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/'
387 verbose audit error ],
387 verbose audit error vary: [ 'Accept-Encoding' ],
387 verbose audit error server: [ 'cloudflare' ],
387 verbose audit error 'cf-ray': [ '78fd816fa9cc5ab4-MEL' ],
387 verbose audit error via: [ 'HTTP/1.1 m_proxy_mel1' ],
387 verbose audit error 'x-fetch-attempts': [ '1' ]
387 verbose audit error },
387 verbose audit error statusCode: 426,
387 verbose audit error code: 'E426',
387 verbose audit error method: 'POST',
387 verbose audit error uri: 'http://registry.npmjs.org/-/npm/v1/security/audits/quick',
387 verbose audit error body: <Buffer 42 65 67 69 6e 6e 69 6e 67 20 4f 63 74 6f 62 65 72 20 34 2c 20 32 30 32 31 2c 20 61 6c 6c 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 20 74 6f 20 6e 70 6d 20 ... 221 more bytes>,
387 verbose audit error pkgid: undefined
387 verbose audit error }
388 silly audit error Beginning October 4, 2021, all connections to npm websites and the npm registry - including for package installation - must use HTTPS and TLS 1.2 or higher.
388 silly audit error
388 silly audit error For more information see this blog post: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
389 timing auditReport:getReport Completed in 325ms
390 silly audit report null
391 timing reify:audit Completed in 325ms
392 verbose stack Error: aborted
392 verbose stack at connResetException (node:internal/errors:718:14)
392 verbose stack at TLSSocket.socketCloseListener (node:_http_client:456:19)
392 verbose stack at TLSSocket.emit (node:events:525:35)
392 verbose stack at node:net:320:12
392 verbose stack at TCP.done (node:_tls_wrap:588:7)
394 verbose Darwin 22.2.0
395 verbose node v18.13.0
396 verbose npm v9.4.0
397 error code ECONNRESET
398 error network aborted
399 error network This is a problem related to network connectivity.
399 error network In most cases you are behind a proxy or have bad network settings.
399 error network
399 error network If you are behind a proxy, please make sure that the
399 error network 'proxy' config is set properly. See: 'npm help config'
400 verbose exit 1
401 timing npm Completed in 43344ms
402 verbose unfinished npm timer command:init 1674780703163
403 verbose unfinished npm timer reify 1674780735103
404 verbose unfinished npm timer reify:unpack 1674780745902
405 verbose unfinished npm timer reifyNode:node_modules/tar 1674780745904
406 verbose unfinished npm timer reify:rollback:createSparse 1674780746457
407 verbose code 1
Node.js v18.13.0
npm --version 9.4.0
yarn 1.22.19

Update to reactive 18.1.0

I try create a react-app with npx create-native init project but the react version was 17.0.2.
I used npm install react react-dom( following https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html) to update for the new version but now I received the message when I try create a nem project: npm ERR! could not determine executable to run.
What should I do?
log:
38 verbose stack Error: could not determine executable to run
38 verbose stack at getBinFromManifest (C:\Users\55319\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmexec\lib\get-bin-from-manifest.js:17:23)
38 verbose stack at exec (C:\Users\55319\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmexec\lib\index.js:135:15)
38 verbose stack at async module.exports (C:\Users\55319\AppData\Roaming\npm\node_modules\npm\lib\cli.js:78:5)
39 verbose pkgid create-native#1.0.0
40 verbose cwd C:\Users\55319
41 verbose Windows_NT 10.0.19044
42 verbose node v16.15.0
43 verbose npm v8.8.0
44 error could not determine executable to run
45 verbose exit 1
46 timing npm Completed in 2369ms
47 verbose code 1
48 error A complete log of this run can be found in:
48 error C:\Users\55319\AppData\Local\npm-cache_logs\2022-05-12T01_59_05_028Z-debug-0.log
CMD
It installed that version because that's the version it's compatible with, as of this writing (RN 68.1). React Native often doesn't use the latest version of React. If you open up the changelog for React Native and search for React 17, you'll see it was introduced into React Native version 64.0. There are no hits for React 18 because it hasn't yet been integrated.

I'm having a problem installing npm vite with vanilla framework in vscode: npm init #vitejs/app = error (esbuild?)

I'm new to Stackoverflow!
I'm having a problem initializing vite build for vanilla (I want to use with three.js) with npm in vscode...
Can someone please help me?
When I run in terminal:
npm init #vitejs/app
Select a framework: vanilla
Select a variant:
First of all, my options are not (like I see in many YouTube video tutorials)
>JavaScript
>TypesScript
they are
>vanilla
>vanilla-ts
If I go ahead with the 'vanilla' option am receiving error on npm install.
The problem seems to be with the esbuild?
npm ERR! path /../prjct-vite/node_modules/esbuild
npm ERR! command failed
npm ERR! command sh -c node install.js
Does anyone have any experience with this?
I'm stuck and don't know how to proceed.
npm -v7.19.1
node -v14.17.3
Does the logfile help decipher the problem?
133 error code 1
134 error path /../prjct-vite/node_modules/esbuild
135 error command failed
136 error command sh -c node install.js
137 error dyld: Symbol not found: _clock_gettime
137 error Referenced from: /../prjct-vite/node_modules/esbuild/bin/esbuild__
137 error Expected in: flat namespace
137 error
137 error The version of the downloaded binary is incorrect: Command failed: /../prjct-vite/node_modules/esbuild/bin/esbuild__ --version
137 error dyld: Symbol not found: _clock_gettime
137 error Referenced from: /../prjct-vite/node_modules/esbuild/bin/esbuild__
137 error Expected in: flat namespace
137 error
137 error
137 error Install unsuccessful
138 verbose exit 1
Thanks in advance!

Unable to install NPM packages due to path length constraint using NPM 5.X

I'm running Windows 10, NPM v5.5.1, and node v8.9.1.
Edit: I have since updated to node v8.9.4 and npm v5.6.0. The problem remains unchanged.
I set up my development environment on this machine about 2 months ago. I'm using Angular CLI to build my client apps.
Everything was going fine. I added a few packages via NPM without a problem, such as Gulp and ngx-bootstrap. Then I started to run into errors on some of my package installs.
The errors are:
npm ERR! code PATH_LENGTH_EXCEEDED
npm ERR! errno PATH_LENGTH_EXCEEDED
npm ERR! request to https://registry/npmjs.org/{{package}} failed, reason: path length constraint exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! {{npm_cache path}}\_logs\2018-02-08T14_43_40_856Z-debug.log
The contents of that log file are:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'ngx-cookie-service',
1 verbose cli '--save' ]
2 info using npm#5.5.1
3 info using node#v8.9.1
4 verbose npm-session d55be12849534a0a
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for ngx-cookie-service#latest request to https://registry.npmjs.org/ngx-cookie-service failed, reason: path length constraint exceeded
8 verbose type system
9 verbose stack FetchError: request to https://registry.npmjs.org/ngx-cookie-service failed, reason: path length constraint exceeded
9 verbose stack at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14)
9 verbose stack at emitOne (events.js:116:13)
9 verbose stack at ClientRequest.emit (events.js:211:7)
9 verbose stack at TLSSocket.socketErrorListener (_http_client.js:387:9)
9 verbose stack at emitOne (events.js:116:13)
9 verbose stack at TLSSocket.emit (events.js:211:7)
9 verbose stack at emitErrorNT (internal/streams/destroy.js:64:8)
9 verbose stack at _combinedTickCallback (internal/process/next_tick.js:138:11)
9 verbose stack at process._tickCallback (internal/process/next_tick.js:180:9)
10 verbose cwd C:\Development\test
11 verbose Windows_NT 10.0.15063
12 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "ngx-cookie-service" "--save"
13 verbose node v8.9.1
14 verbose npm v5.5.1
15 error code PATH_LENGTH_EXCEEDED
16 error errno PATH_LENGTH_EXCEEDED
17 error request to https://registry.npmjs.org/ngx-cookie-service failed, reason: path length constraint exceeded
18 verbose exit [ 1, true ]
I researched this, and found the Windows 10 file path 260 character limitation. I thought that npm version 3.1.0 should have fixed this issue, but I decided to followed the instructions in this answer, because I'm still running into this issue despite using NPM v5.5.1.
I found that my version of Windows was prior to the roll out of the feature that lets you disable this limitation. I updated to Version 1703 (OS Build 15063.483), and to enable Win32 long paths.
Yet I'm still getting the error, and unable to install a variety of npm packages.
In testing to see if it was an issue with packages that have a lot of dependencies, I tried installing or reinstalling a couple of other packages.
Some fail with the errors above. Others succeed with the following warnings:
npm WARN Unexepcted warming for https://registry.npmjs.org/: Miscellaneous Warning PATH_LENGTH_EXCEEDED: request to https://registry.npmjs.org/{{package name}} failed, reason: path length constraint exceeded
npm WARN Using stale package data from https://registry.npmjs.org/ due to a request error during validation
Packages throwing the error include:
jslint
ngx-cookie-service
chart.js
angular-cli
Packages that throw the warnings include:
font-awesome
#angular/cli
moment
ngx-bootstrap
bootstrap
jasmine
I suspect that something has changed, either in a policy on my workstation, or in our network security, that is causing this. All of the packages that succeed seem to be packages that I had previously installed, either as a direct install, or as a dependency of #angular/cli (one of the first packages I installed). I'm assuming that the stale package data warning indicates that whatever problem I have with the path length is preventing updated data being retrieved, and therefore npm is falling back to cached data from previous installations of the selected package and its dependencies.
So now I'm stumped as to how to diagnose exactly where the issue is happening. If its a security policy that changed, then I need to be able to describe exactly what is being blocked so that I can work with our security department to fix this. But the only information I can find about the PATH_LENGTH_EXCEEDED errors lead me to old information about versions of npm prior to 3.1.0.
How can I identify the source of this problem?
After additional searching, I found references to path length exceeded with regards to SSL/TLS certificate authorities. I tested this issue by changing the npm registry to use http instead of https (note: this is a temporary step only; I have turned https back on once I verified the issue):
npm config set registry http://registry.npmjs.org/
This allowed me to install the problematic packages.
It seems the underlying cause is SSL Inspection performed by our network security team. The decryption, inspection, and re-encryption process, and subsequent changes in the Issuing Authority on the certificate, apparently triggers this error.

npm install error - setting dev env

trying set up dev env for kibana
i cloned kibana ; cd kibana
and run npm install
getting the following error :
C:\kibana>npm install
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "elasticsearch"
19 error node v6.10.3
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error kibana#6.0.0-alpha2 elasticsearch: `grunt esvm:dev:keepalive`
22 error Exit status 1
23 error Failed at the kibana#6.0.0-alpha2 elasticsearch script 'grunt esvm:dev:keepalive'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the kibana package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error grunt esvm:dev:keepalive
23 error You can get information on how to open an issue for this project with:
23 error npm bugs kibana
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls kibana
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]