npm ERR! cb() never called, on windows10 while creating first react project - node.js

While creating first react app using command "create-react-app myfirstapp", I got the following errors:
D:\ReactProject>create-react-app myfirstapp
Creating a new React app in D:\ReactProject\myfirstapp.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\intex\AppData\Roaming\npm-cache\_logs\2021-02-19T07_57_36_091Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting myfirstapp/ from D:\ReactProject
Installed ReactJS version is:
D:\ReactProject>create-react-app --version
4.0.2
Installed Node version is:
D:\ReactProject>node -v
v14.15.5
Note: This is first time I am creating ReactJS app on Windows machine, so installed NodeJS first time on this machine and tried to create the react app and got the above errors.
Please let me know your suggestions on fixing these errors.
Also, find attached screenshot of the above.

I tried couple of things, but the following worked for me.
I run this command "npm install --global windows-build-tools" using
Administrative privileges and it worked for me.

I tried on windows 10 just now. I used PowerShell Window. Simple, go to your project directory -> hold the shift button and click the right mouse button -> select 'Open PowerShell window here' -> start in that cmd. It works for me.

Related

While I'm trying to create React app this particular error is coming

C:\Users\souvik das>cd documents
C:\Users\souvik das\Documents>npx create-react-app blog
Creating a new React app in C:\Users\souvik das\Documents\blog.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ERR_SSL_CIPHER_OPERATION_FAILED
npm ERR! errno ERR_SSL_CIPHER_OPERATION_FAILED
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/react-dom: F42A0000:error:1C800066:Provider routines:ossl_gcm_stream_update:cipher operation failed:c:\ws\deps\openssl\openssl\providers\implementations\ciphers\ciphercommon_gcm.c:312:
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\souvik das\AppData\Local\npm-cache\_logs\2022-05-04T16_20_42_133Z-debug-0.log
Aborting installation.
npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting blog/ from C:\Users\souvik das\Documents
Done.
have you tried updating the package by using npm update create-react-app?
I solved the issue , just go to windows settings -> Network reset -> reset now
and hit the reset .. and restart your PC . it worked for me
Got the same Provider routines:ossl_gcm_stream_update:cipher operation failed error on Node 18 with npm 8.x during npm install. Running the below command worked for me.
npm cache verify

React npm start issue -- ELIFECYCLE, errno1

Any time I try to run npm start I get an error saying:
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! dbproject#0.1.0 start: set PORT=9999 && react-scripts start npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the dbproject#0.1.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
So far I've tried:
-Changing environment variables, my current environment variables are these
-Cleaning the npm cache, deleting the node_modules and then running npm install again
-I tried running npm start in different project folders, none of the React projects work, they all throw the same error. Node servers run well, I haven't tried running anything else.
Pastebin of the full console log: https://pastebin.com/P8DDDaDq
Pastebin of the debug.txt file: https://pastebin.com/1ebezKX2
I'm running Windows 10 Home Build 17134.
I would be extremely grateful of any help
Problem solved!
Leaving the solution that worked for me here in case it is helpful for anyone.
Here's what I did:
1.- Uninstall node
2.- Restart your computer
3.- Install node again
4.- Install React running npm install -g create-react-app
5.- Create a new React project folder running npm create-react-app yourProjectName, place all your project files here except for the node_modules folder and the package.json files
6.- After you have done that install all of your dependencies manually with npm, it should work fine now!

attempting to deploy meteor application. Fails when running NPM INSTALL

Sorry for the following wall of text.
So I've been using someone else's meteor app. (they open sourced it) It's currently un-built and I've been running it on dev-mode. It's a lot slower than expected and users are having issues connecting to my local machine. So I'm attempting to deploy the app by following: https://guide.meteor.com/deployment.html#deploying.
So I've been getting errors when trying to run npm i. My dad recommended me to run npm cache verify and try again, then npm cache clean as a last resort. Neither worked and I've still am getting errors. Although as soon as I tried again after running npm cache verify the error amount skyrocketed. I unfortunately don't have the errors I got before I cleared my cache but I have the current logs here: https://pastebin.com/dAcRnE9v But here is a snapshot:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fibers#2.0.2 install: `node build.js || nodejs build.js`
npm ERR! Exit status 1
npm ERR! Failed at the fibers#2.0.2 install script.
I honestly don't have any idea what todo. I've never worked with meteor before, nor the fibers module that's failing. I don't even know if this is the right place I should be asking for help.
I once had fibers npm package in my package.json which caused a similar error. Once I removed it everything built just fine.
You can't change Meteor's version of node - for compatibility reasons it bundles node/npm with Meteor to protect you. Just prefix all your npm/node commands with meteor like this:
meteor npm install
It won't use the node version (13.x) that you have installed

Create New React Native app

I am getting an error on creating my first react native app.
I am using following guide -
https://facebook.github.io/react-native/docs/getting-started.html
https://github.com/react-community/create-react-native-app
$ npm install -g create-react-native-app
--Worked fine
$ create-react-native-app my-first-native-app
--app created without errors
$ npm start
--gives error
Error: React native is not installed. Please run `npm install` in your project directory.
1:09:05: Error starting packager: Error: Couldn't start project. Please fix the errors and restart the project.
at C:\xdl\src\Project.js:1329:11
at Generator.next (<anonymous>)
at step (C:\reactJs-projects\my-first-native-app\node_modules\xdl\build\Project.js:1735:191)
at C:\reactJs-projects\my-first-native-app\node_modules\xdl\build\Project.js:1735:361
at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-first-native-app#0.1.0 start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-first-native-app#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Tried fixing with downgrading npm to version 4 as recommended all over that version 5 has bugs.
npm i -g npm#4
I have also tried latest npm but neither of them worked.
When I run npm install on my project directory, instead of installing/updating my packages, it is giving following error
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://github.com/npm/npm/issues>
I see all dependencies downloaded in node_modules though
Any suggestion on what I have missed?
What I also noticed is when the app is created (using create-react-native-app my-first-native-app) it also added following error in console
yarn install v0.21.3
[1/4] Resolving packages...
warning jest-expo > jest > jest-cli > istanbul-api > istanbul-lib-hook#1.2.1: 1.2.0 should have been a major version bump
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/react-native-web-maps/-/react-native-web-maps-
0.1.0.tgz: invalid tar file".
info If you think this is a bug, please open a bug report with the information provided in "C:\\reactJs-projects
\\MyNewNativeApp\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Failed to install
Thank You!
Reinstall your NPM/YARN and get the newest version of React Native i have this problem too
after create your project with
$ create-react-native-app my-first-native-app
after you should enter your project folder :
$ cd my-first-native-app
and then open emulator or connect to tour device and run with
$ npm start
or
$ react-native run-android
pay attention you had installed android-SDK and android-JDK and your emulator is running
After trying different versions, I ended up using yarn and it worked on first instance. If anyone struggles with similar problem, then I would recommend using Yarn and move on. One can switch back to npm after the app is created. This is very common issue reported and for many developers it works with certain version.
Create new project using command : npx react-native init ProjectName
Create new project using particular version of react native :
npx react-native init ProjectName --version X.XX.X
After that go to project location
cd ProjectName
Run application on android platform
npx react-native run-android

npm ERR! errno -5

hi i am getting this error when I try typical starter command with react native
react-native init test
returns this error
npm WARN react-native#0.44.0 requires a peer of react#16.0.0-alpha.6 but none was installed.
Setting up new React Native app in /Users/xxxx/ReactNativeProjects/gpss
Installing React...
gpss#0.0.1 /Users/xxxxx/ReactNativeProjects/gpss
└── react#16.0.0-alpha.6
Installing Jest...
npm ERR! code EIO
npm ERR! errno -5
npm ERR! syscall read
npm ERR! EIO: i/o error, read
You could uninstall react-native and then use the following command:
npm install react#reactversion --save.
Note (reactversion) is your desired version you want to have.
You could also just try reinstalling it as:
npm install react --save
Or upgrade with:
npm update react-native
Eventually cleaning the cache worked out fine. Hope this answer solves any user's problem in the future.
I just had the same problem on Windows, using Virtual Studio Code. I uninstalled an unrelated program shortly before the error and I suspect that was the cause. So I restarted my PC and updated Windows and the npm errors were gone. Everything is working and disaster averted.
Try closing background tasks, updating and/or restarting your computer.

Resources