why when i try to install Eslint in Atom , then Atom install packeges form don't see this package? - package

ESlint install to user/.atom/packages. In Atom install packedes field type linter-eslint
I tried:
npm install eslint --save-dev
I got:
up to date, audited 252 packages in 3s
90 packages are looking for funding run `npm fund` for details
but Atom package installer don't see it
I tried:
apm install linter-eslint
I got:
*TypeError: Cannot read property 'latest' of undefined
at /snap/atom/286/usr/share/atom/resources/app/apm/lib/install.js:256:29
at Request._callback (/snap/atom/286/usr/share/atom/resources/app/apm/lib/request.js:57:22)
at Request.self.callback (/snap/atom/286/usr/share/atom/resources/app/apm/node_modules/request/request.js:185:22)
at Request.emit (events.js:223:5)
at Request.<anonymous> (/snap/atom/286/usr/share/atom/resources/app/apm/node_modules/request/request.js:1154:10)
at Request.emit (events.js:223:5)
at IncomingMessage.<anonymous> (/snap/atom/286/usr/share/atom/resources/app/apm/node_modules/request/request.js:1076:12)*

Related

I trying to install axios to my react project but there is an error

this is the error I got when I tried to install axios in my react Project
PS C:\Users\mohamud\Desktop\reactapp> npm install axios
added 3 packages, and audited 1469 packages in 2m
225 packages are looking for funding
run `npm fund` for details
6 high severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.

I can't create app using "npx create-react-app my-app"

I'm trying to create a react app with "npx create-react-app my-app" but I'm getting this error.
PS C:\Users\m.saral\Desktop\app> npx create-react-app my-app
Creating a new React app in C:\Users\m.saral\Desktop\app\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
Aborting installation.
Error: spawn UNKNOWN
at ChildProcess.spawn (node:internal/child_process:420:11)
at Object.spawn (node:child_process:733:9)
at spawn (C:\Users\m.saral\AppData\Roaming\npm\node_modules\create-react-app\node_modules\cross-spawn\index.js:12:24)
at C:\Users\m.saral\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:383:19
at new Promise (<anonymous>)
at install (C:\Users\m.saral\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:334:10)
at C:\Users\m.saral\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:461:16
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
Deleting generated file... package.json
Deleting my-app/ from C:\Users\m.saral\Desktop\app
Done.
PS C:\Users\m.saral\Desktop\app> node -v
v16.18.0
I tried running command prompt as administrator
I tried:
npm uninstall -g create-react-app
npm uninstall create-react-app
I deleted and reinstalled Nodejs
npm install npm#latest -g
Node Version: v16.18.0
Npm Version: 8.19.2
Please try with the Latest nodejs Version For Window https://nodejs.org/en/
Also check npm Version as WEll
Problem solved
I could not find why the problem was solved when trying randomly
PS C:\Users\m.saral\Desktop\app\my-app> npm -v
8.19.2
PS C:\Users\m.saral\Desktop\app\my-app> npx -v
8.19.2
PS C:\Users\m.saral\Desktop\app\my-app> node -v
v16.18.0
PS C:\Users\m.saral\Desktop\app\my-app> npm -g list
C:\Users\m.saral\AppData\Roaming\npm
├── create-react-app#5.0.1
├── npm#8.19.2
└── tar#2.0.0
PS C:\Users\m.saral\Desktop\app> npx create-react-app my-app
Creating a new React app in C:\Users\m.saral\Desktop\app\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
added 1392 packages in 1m
212 packages are looking for funding
run `npm fund` for details
Initialized a git repository.
Installing template dependencies using npm...
added 56 packages in 6s
212 packages are looking for funding
run `npm fund` for details
Removing template package using npm...
removed 1 package, and audited 1448 packages in 2s
212 packages are looking for funding
run `npm fund` for details
9 high severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
Created git commit.
Success! Created my-app at C:\Users\m.saral\Desktop\app\my-app
Inside that directory, you can run several commands:
npm start
npm run build
Bundles the app into static files for production.
npm test
Starts the test runner.
npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd my-app
npm start
Happy hacking!

react-native installing react-native-gesture-handler just hands and doesn't install

I am trying to install react-navigation so I can add navigation to my react app. I am following the instructions on https://facebook.github.io/react-native/docs/navigation but I can not get it to all install properly.
I am on a windows machine and have react versions
"react": "16.9.0",
"react-native": "0.61.5",
I installed react-native
npm install -g react-native
I installed the cli
npm install -g --save react-native-cli
I created my app
react-native init MyReactNativeApp
I cd'ed into that folder
cd MyReactNativeApp
I installed react-navigation
npm install -g --save react-navigation
npm install #react-navigation/native #react-navigation/stack
I am trying to run the next step which is the following, however it just hangs
If you have an bare React Native project, install the dependencies with npm:
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context #react-native-community/masked-view
Further investigations shows i can install all the following all ok
npm install react-native-reanimated
npm install react-native-screens
npm install react-native-safe-area-context
npm install #react-native-community/masked-view
Its the install of "react-native-gesture-handler" which just hangs, i do not get any error message
npm --save install react-native-gesture-handler
[..................] - loadDep:prop-types: sill resolveWithNewModule react-native-gesture-handler#1.5.6 checking installable status
I have searched the net and tried a number of things, such as those below but nothing works
run my command window as an administrator
removed the react-native-safe-area-view folder from node-modules and tried again
put my GIT home on my PATH
I believe without this i can not use react-navigation and my app fails to run.
I do not understand why this is not working when i am following the official documentation.
UPDATE
Eventually it failed (after about 10 mins) with
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t
https://github.com/naver/hammer.js.git
npm ERR!
npm ERR! undefined
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\MYUSER\AppData\Roaming\npm-cache\_logs\2020-02-
12T13_26_03_301Z-debug.log
The log file contents do not say anything more than the error
43 error Error while executing:
43 error C:\Program Files\Git\cmd\git.EXE ls-remote -h -t
https://github.com/naver/hammer.js.git
43 error
43 error undefined
43 error exited with error code: 128
GIT on my machine
>which git
C:\Program Files\Git\cmd\git.EXE
>git --version
git version 2.21.0.windows.1
Confirm you have git installer and available in command line
Since you are using rn 61, you should initialize your project with npx
npx react-native init AwesomeProject
The error implied that GIT can not access the given site. I'm behind a corporate Firewall. I set a proxy in git and I can now install "react-native-gesture-handler"
git config --global http.proxy http://host:port

Unable to create a react app using "create-react-app"

I have installed "create-react-app" globally on my pc using "npm install create-react-app -g". And it worked just fine for months. I had previously created a lot of react app using the "create-react-app app-name" command. And it worked flawlessly. Until a few days ago when it sudden stopped working and started giving errors. I have tried various things suggested but with no luck. So after days of trying to solve the issue I am asking this question.
I have tried doing the following things:
1> using the "npm cache clean --force" and then "npm cache verify".
2> I also unabled my antivirus (norton) and then ran the commands.
3> I installed the latest node version
4> I intalled the latest npm version and updated it using the command "npm install npm#latest -g"
5> I followed the instructions on this stackoverflow link https://stackoverflow.com/questions/50189096/installing-create-react-app-gives-npm-err-shasum-check-failed-and-npm-err-unex/50191315#50191315 to change the registry.
And a few other things. But nothing has worked.
The error that I get is as follows:
D:\codes\react\maximilianUdemy\project1>create-react-app react-mytest-app
Creating a new React app in D:\codes\react\maximilianUdemy\project1\react-mytest-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! Unexpected end of JSON input while parsing near '...HqQqP7Ky/f49Ar0oPZ\n4'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\vaibh\AppData\Roaming\npm-cache\_logs\2019-07-20T10_24_27_969Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file... package.json
Deleting react-mytest-app/ from D:\codes\react\maximilianUdemy\project1
Done.
Below is an excerpt from the C:\Users\vaibh\AppData\Roaming\npm-cache\_logs\2019-07-20T10_24_27_969Z-debug.log. Since the log is really big (664 lines), I have only noted from when the error started showing.
471 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...HqQqP7Ky/f49Ar0oPZ\n4'
471 verbose stack at JSON.parse (<anonymous>)
471 verbose stack at parseJson (D:\Program_Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
471 verbose stack at D:\Program_Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
471 verbose stack at processTicksAndRejections (internal/process/task_queues.js:85:5)
472 verbose cwd D:\codes\react\maximilianUdemy\project1\react-mytest-app
473 verbose Windows_NT 10.0.17134
474 verbose argv "D:\\Program_Files\\nodejs\\node.exe" "D:\\Program_Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts"
475 verbose node v12.6.0
476 verbose npm v6.9.0
477 error Unexpected end of JSON input while parsing near '...HqQqP7Ky/f49Ar0oPZ\n4'
478 verbose exit [ 1, true ]
Try to use npx create-react-app my-app
I think also information in this link will help you.
This problem is create-react-app version with respect to node version.
Create new project
npx create-react-app project_name --template all
Node
create-react-app
First use npx create-react-app, but if the problem persists ->
This will happen usually due to 1 of the two reasons :
Your npm registry is messed up somehow.
You have an old version of 'create-react-app'.
To solve this try:
Run npm get registry to see your current, and npm set registry https://registry.npmjs.org/ to set the registry to default.
To get the new version of create-react-app, simply uninstall the old one globally through npm uninstall -g create-react-app and then run npx create-react-app for creating your react app.

After npm install tachyons, tachyons package not added in package.json?

npm install output:
npm WARN afterxii#1.0.0 No description
npm WARN afterxii#1.0.0 No repository field.
+ tachyons#4.11.1
updated 1 package and audited 518 packages in 5.404s
found 0 vulnerabilities
How can it be added in package.json
You should include the command you're executing.
However, I assume that you executed npm install. To add a package to dependencies you should do npm install --save or npm install --save-dev.
More info in the documentation https://docs.npmjs.com/cli/install

Resources