I am trying create my first react app and running into issues basically at step 1. I am trying npm start on the default create-react-app install and I am getting the follow error. I have included screenshots showing create-react-app ran successfully but that has not fixed anything. I have included screenshots of it successfully running create-react-app and of me running npm start with no luck. Thanks.
Here is the log file:
18 verbose npm v6.4.1
19 error file sh
20 error code ELIFECYCLE
21 error errno ENOENT
22 error syscall spawn
23 error robofriends#0.1.0 start: react-scripts start
23 error spawn ENOENT
24 error Failed at the robofriends#0.1.0 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
I tried this solution and it did not work for me:
stackoverflow.com/a/42539669/5069226
create-react-app running
npm start failing
Looks like this has to do with your workspace path.
I tried to replicate this on my machine with the path /tmp/Users/Neil/Desktop/Complete Web Developer/Section 18_React:Redux/robofriends, and i was able to reproduce your error.
╭─ /tmp/Users/Neil/Desktop/Complete Web Developer/Section
18_React:Redux/robofriends
╰ yarn start K8S: tools 11:37:33
yarn run v1.7.0
$ react-scripts start
/bin/sh: react-scripts: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
But when i moved the robofriends directory up higher in the tree, it worked fine.
╭─ /tmp/Users/robofriends
╰ yarn start K8S: tools INT(-2) ↵ 11:38:34
yarn run v1.7.0
Starting the development server...
I guessed it could be either the long path to node modules or the non-alphanum characters you have in your path, :,_. So i went back down to the React:Redux directory and renamed it to ...React_Redux and tried npm start again in /tmp/Users/Neil/Desktop/Complete Web Developer/Section 18_React_Redux/robofriends`, and it worked just fine :)
So looks like npm doesn't like the : in the executable path.
Related
Trying to my Next.js app using vercel, have tried both the cli and web app. Either way, not working. Error log:
2022-04-18T00:57:21.354Z Retrieving list of deployment files...
2022-04-18T00:57:23.121Z Downloading 29 deployment files...
2022-04-18T00:57:24.298Z Installing build runtime...
2022-04-18T00:57:27.316Z Build runtime installed: 3.018s
2022-04-18T00:57:27.999Z Looking up build cache...
2022-04-18T00:57:28.609Z Build Cache not found
2022-04-18T00:57:28.805Z Installing dependencies...
2022-04-18T00:57:30.687Z npm ERR! code ENOLOCAL
2022-04-18T00:57:30.692Z npm ERR! Could not install from "node_modules/eth-sig-util/ethereumjs-abi#git+https:/github.com/ethereumjs/ethereumjs-abi.git" as it does not contain a package.json file.
2022-04-18T00:57:30.713Z
2022-04-18T00:57:30.713Z npm ERR! A complete log of this run can be found in:
2022-04-18T00:57:30.713Z npm ERR! /vercel/.npm/_logs/2022-04-18T00_57_30_693Z-debug.log
2022-04-18T00:57:30.725Z Error: Command "npm install" exited with 1
2022-04-18T00:57:31.523Z
Not sure what is causing this. I am able to npm run dev on local and everything works correctly. I am also able to npx next build and that works fine too. Any ideas how to fix this issue? Thanks
I did a react project for my bootcamp, and just pulled it down from my github again, after running npm i and npm run-script build I am getting a white screen with 3 errors in the console. 2 of the errors are Uncaught SyntaxError: Unexpected token '<' and the other is Manifest: Line: 1, column: 1, Syntax error.
These errors are not showing on the deployed version, and I am wondering how to get rid of them so I can start working on it on my local host.
Repo: https://github.com/childishmartino/Book-Search-Engine
The structure of your project has three package.json files.
./package.json
./Client/package.json
./Server/package.json
The package.json at the root level has a script install that navigates to the other folders and installs the packages. You should run both npm i at the root to install those packages, and either npm i in each of the sub-folders, or your script, npm run install at the root to install everything required. Then npm run develop to start the applications.
I cloned you project, and was able to run successfully using Node 14.7.4
You should run
npm run install as this is a script that installs the node modules both in the server and client directory.
npm i installs the scripts in the root directory, that's why you get those errors.
What went wrong:
Task 'installDebug' not found in project ':app'.
Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 2m 46s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
npm ERR! code 1
npm ERR! path xxx
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c react-native run-android
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xxx\AppData\Local\npm-cache_logs\2021-03-23T11_07_55_756Z-debug.log
I tried all solutions from these questions but no help, please help me to resolve this issue:
Task 'installDebug' not found in project ':app'
I get error on my react-native app while I am trying to execute following code
React-native and it dont work, accusing some error "Task 'installRelease' not found in project ':app'"
I tried :
react-native start --reset-cache
npm start --reset-cache
npm install
gradlew clean
Invalid cache restart
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.
I'm deploy react app to git hub pages and receive error. File sizes after gzip:
68.67 KB build\static\js\2.c2c334ae.chunk.js
2.98 KB build\static\js\main.8a72b1a2.chunk.js
774 B build\static\js\runtime~main.8f8a00a4.js
The project was built assuming it is hosted at /sort-customers-list/.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
To publish it at https://sejob.github.io/sort-customers-list,
run: npm run deploy
Find out more about deployment here:
sort-customers-list#0.1.0 deploy
C:\Users\SeJo\Documents\Code\DEV_HW\sort-customers-list
gh-pages -d build
The "file" argument must be of type string. Received type undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sort-customers-list#0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sort-customers-list#0.1.0 deploy 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:
npm ERR!
C:\Users\SeJo\AppData\Roaming\npm-cache\_logs\2019-08-01T12_09_52_445Z-debug.log
The problem occurs in the new version of GitHub pages. Just use this command to install the previous version of GitHub pages:
npm install gh-pages#2.0.1
Hope it will help!
I also had this same problem on a fresh install of create-react-app. I have no idea what the problem was, but I did the following:
Downgrade gh-pages from 2.1.0 to 2.0.1
Instead of running npm run deploy, manually run npm run build then gh-pages -d build from the commandline.
At first, I'd get the same error in the commandline, even after checking that the version was downgraded to 2.0.1, but for some reason it worked after manually creating the gh-pages branch and pushing some files into it. As of now, npm run deploy throws the error but at least gh-pages -d build from the console works.
INSTALL/REINSTALL GIT
Update NPM
Reopen EDITOR
this solved my problem
use version 2.0.1
npm i gh-pages#2.0.1