create-react-app running issue even after just created it - reactjs

*npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:*
or sometimes I am different kind of errors just after creating the app. which means no modifications to the default automatic generated project.

and I managed to solved it.
the issue seems to be with my Yarn. incomplete uninstall or something like that. can't solve it by just reinstalling Yarn or uninstall it again. because of that, NPM create-react-app also create bugs, which IDK how.
but the solution is amazing, I just created the project in a different folder. trust me I'm not lying , different location do works in NPM. so I believe I need to format my computer to solve this 100%.
The cause maybe due to I have installed create-react-app via NPM globally and tries to install Yarn create-react-app.
anyway, by using a different folder location, my issue was fixed completely.

Related

npm start problem: npm ERR! code ELIFECYCLE

I've got some problem with starting app by using 'npm start'. After create react files folder and using that command I can see:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! weatherapp#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the weatherapp#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I want to add that I've used react before. I was running code the same way but everything was good. What's the solution?
Make sure you are writing the npm start command to correct package where your package.json resides.
More likely it seems you don't have react script installed.
Can you try installing script with following command.
npm i react-scripts
This may solve your problem. Happy learning :)
Try to remove node_modules and package.log or yarn.lock file also. and run npm install again. Should solve your problem.

Create-react-app don't run even just after create it

*npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github#0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:*
or sometimes I am different kind of errors just after creating the app. which means no modifications to the default automatic generated project.
and I managed to solved it.
the issue seems to be with my Yarn. incomplete uninstall or something like that. can't solve it by just reinstalling Yarn or uninstall it again. because of that, NPM create-react-app also create bugs, which IDK how.
but the solution is amazing, I just created the project in a different folder. trust me I'm not lying , different location do works in NPM. so I believe I need to format my computer to solve this 100%.
The cause maybe due to I have installed create-react-app via NPM globally and tries to install Yarn create-react-app. anyway, by using a different folder location, my issue was fixed completely.
Formatting the computer isn't a solution for this.
This error indicates that you probably have installed through npm install -g create-react-app
which is old version.
I think you need to uninstall and install again using npx create-react-app
Steps
1 - npm uninstall -g create-react-app
or
yarn uninstall -g create-react-app
2 - npx create-react-app my-app
npx comes with npm 5.2+ and higher, see instructions for older npm
versions.
check this create-react-app latest one

npm start does not work for ract template project

Running npm start after npm init does not work due to reported missing react-script library.
It is on my Windows 10 machine; I tried uninstalling and reinstalling node but it did not help.
I can only run my project by typing
>node .\node_modules\react-scripts\bin\react-scripts.js start
otherwise if I run:
>npm start
I can see errors pasted below.
reactapptest#0.1.0 start C:(...)\reactapptest
react-scripts start
npm ERR! file bash
npm ERR! path bash
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn bash
npm ERR! reactapptest#0.1.0 start: react-scripts start
npm ERR! spawn bash ENOENT
npm ERR!
npm ERR! Failed at the reactapptest#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
It looks like something is wrong with my path but I am not sure and I do not know how to solve it.
The specific error you are getting points out that bash is not available. Now bash is a shell for Unix and Unix-like environments, it is not typically installed on Windows by default. (Though it is available for Windows as well through MinGW.)
You are working on Windows, you should not need bash with react-scripts. Try upgrading npm with npm install -g npm#latest to see if this is caused by an old and broken version of npm on your system.
EDIT: Also, you may have previously configured npm to use bash. See: how to set shell for npm run-scripts in windows and note that you are pretty much trying to do the opposite, so if you have custom configuration you might want to try removing it (also explained in the linked accepted answer).

Troubles after upgrading react-native to 0.56

i have troubles updating the new version of react-native which appears to improve vastly and a lot of features.
After reading this article :
https://facebook.github.io/react-native/blog/2018/07/04/releasing-react-native-056
I've started to run this command : https://facebook.github.io/react-native/docs/upgrading.html
All goes well, the application is built after running react-native run-ios
The problem is the bundle which is buggy :
node node_modules/react-native/local-cli/cli.js start "--reset-cache"
Scanning folders for symlinks in
/Users/julestruong/Dev/BAP/flex/v1/flex-mobile-app/node_modules (14ms)
warning: the transform cache was reset.
Cannot find module 'metro/src/transformer'
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! flex#0.0.1 start:
node node_modules/react-native/local-cli/cli.js start
"--reset-cache" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at
the flex#0.0.1 start script. npm ERR! This is probably not a problem
with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
Tries :
remove node_modules
start --reset-cache
delete package-lock.json and reinstall.
Nothing works ...
If you're using typescript you'll need to upgrade react-native-typescript-transformer to 1.2.10 since metro moved the transformer it relies on.

npm won't create a symlink for webdriver-manager while using JHipster DevBox

I'm trying to use JHipster with the DevBox at work, so with a proxy.
I think I have everything configured accordingly, but I still can't use JHipster properly.
I want to generate a microservice gateway with Protractor, but when I use yo jhipster or npm install, it gives me the following error:
> example-gateway#0.0.0 postinstall /home/vagrant/workspace/example/example-gateway
> webdriver-manager update
sh: 1: webdriver-manager: not found
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.12
npm ERR! Linux 3.13.0-88-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.4.5
npm ERR! npm v3.9.6
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! example-gateway#0.0.0 postinstall: `webdriver-manager update`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the example-gateway#0.0.0 postinstall script 'webdriver-manager update'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the example-gateway package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webdriver-manager update
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs example-gateway
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls example-gateway
npm ERR! There is likely additional logging output above.
And with sudo:
npm WARN lifecycle example-gateway#0.0.0~postinstall: cannot run in wd %s %s (wd=%s) example-gateway#0.0.0 webdriver-manager update /home/vagrant/workspace/example/example-gateway
However, I found webdriver-manager in the node_modules/protractor/bin directory, but npm seems to be unable to use it.
Actually, I already succeeded once in generating a microservice gateway with Protractor, but I don't know how: the error about webdriver-manager just disappeared one day. Indeed, there was several other errors (packages that didn't want to be installed), and running npm install over and over again while sometimes installing manually some packages seemed to fix them. However I'm trying to use JHipster on another computer so I need to know how to fix the webdriver-manager error.
I took a look in the node_modules folder of the completed gateway project, and discovered a webdriver-manager symlink inside .bin that wasn't in the same directory of the incomplete gateway project, so I supposed npm used it instead of the one in the node_modules/protractor/bin directory. I created one linking the two in the node_modules/.bin directory of the incomplete gateway project with ln -s ../protractor/bin/webdriver-manager webdriver-manager, and it apparently worked.
The problem is that I'm trying to make the installation and the configuration of the JHipster DevBox somehow automated, so people at work wanting to use it don't have to do it manually. If they have to remember to create a symlink each time they encounter that error, it won't be very practical.
Do you know why npm won't create that symlink himself (or sometime fails to install some packages), and how to fix it in a "clean" way?
Ok I found a solution, but I still don't know exactly why it does this and if their is a cleaner way to fix it.
http://perrymitchell.net/article/npm-symlinks-through-vagrant-windows/
I just replaced the node_modules directory by a symlink to somewhere inside the guest machine, so not in the shared folder with Windows. That way, I skip all the problems caused by Windows. The downside is I have to create the link before generating any project, and to fix that link and download again all the dependencies each time I update the DevBox, because I need to destroy the DevBox to update it.

Resources