(error) AWS as backend installing amplify libraries - reactjs

I am new to backend. Just starting to make a To-Do app in react and was just setting up amazon aws for backend. Using this site for reference ( https://docs.amplify.aws/start/getting-started/setup/q/integration/react#initialize-a-new-backend ).
And at the point Install Amplify libraries I got stuck while i type npm install aws-amplify #aws-amplify/ui-react in root directory it shows me error everytime.[error pic][1] I am trying for a long but did not find any solution. Pls help me in this issue !!
[1]: https://i.stack.imgur.com/hrSeJ.png Here is the error i'm getting in command prompt👇
npm ERR! Unexpected end of JSON input while parsing near '...:"^1.0.0-beta.2","#aw'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Aakash~1Bansal\AppData\Roaming\npm-cache\_logs\2021-04-09T11_41_43_000Z-debug.log
F:\Learning- tanay pratap\AWS\react-amplified>npm install aws-amplify #aws-amplify/ui-react
npm ERR! Unexpected end of JSON input while parsing near '...:"^1.0.0-beta.2","#aw'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Aakash~1Bansal\AppData\Roaming\npm-cache\_logs\2021-04-09T11_45_14_875Z-debug.log
F:\Learning- tanay pratap\AWS\react-amplified>

I was having the same issue. 1st make sure your PC is connected to internet connection. Run:
npm uninstall -g #aws-amplify/cli
npm install -g #aws-amplify/cli
If possible don't minimize the window wait till everything is properly install.
This worked for me.
Still you are facing problems then reinstall node.js and then do this.
Thank you!

Related

issue deploying to vercel, works on local?

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

configure unicode-match-property-value-ecmascript on reactjs

I am trying to run REACT frontend and Flask backend using concurrently but every time I run it I get this error
Error: Cannot find module 'unicode-match-property-value-ecmascript'
I have tried installing the dependency using
npm install unicode-match-property-value-ecmascript
But I get this error on vscode powershell
npm ERR! code UNKNOWN
npm ERR! syscall rename
Any help will be appreciated

Create-react-app dependency version issues

I am trying to create a basic react app using the command:
npx create-react-app my-app
At work we use JFrog Artifactory to manage our npm packages. When trying to use the above command, I get the following error:
npm ERR! 403 403 Forbidden - GET https://artifactory.XYZ.domain:443/artifactory/api/npm/npm-main/ansi-regex/-/ansi-regex-4.1.0.tgz
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy.
npm ERR! 403
npm ERR! 403 It was specified as a dependency of 'wrap-ansi'
Sure enough, when I look in Artifactory I can see that v4.0.1 is blocked due to a security vulnerability. What are my options here please? Is it possible to somehow force create-react-to instead use a later version without the vulnerability (looks like v5.0.1 is fine)?
Thanks for your help
you can do
npm config set registry <path/to/artifactory>
///create your react project:- npm create-react-app myapp
//then revert to older config if you want to by
npm config delete registry
let me know if it works

Cannot Resolve firebase in my application

So I'm developing an app using firebase and react, and when I run npm start to test the app, I get a lot of errors including this
./src/Login.js
Module not found: Can't resolve 'firebase' in '/Users/.../.../.../.../project/src
And this (the full error is too large to show, but here's the end snippet):
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc#1.23.3 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc#1.23.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Here is the import statement in Login.js
import * as firebase from "firebase";
Its important to note that I'm working with friends on this application and they can run this app using npm start without any issues and even build and deploy to firebase hosting using the exact same code I have. In addition, I can run the template React app created via create-react-app without any issue. Because of this, I thought it was either a problem with my NPM install or my Firebase install, so I re-installed both, but that changed nothing. I'm honestly stuck and I would really appreciate any help.

React Navigation npm install ERR fresh Expo Init #react-navigation/native#3.1.4

React Native Expo Users!
I am running into error on expo init with react-navigation (both blank & with tabs):
npm ERR! 404 '#react-navigation/native#3.1.4' is not in the npm registry.
I have been developing with React Native using Expo for several months now and have great success learning and solving errors along the way!
I took a holiday, came back to start a new project, and hit a wall with react-navigation#^3.0.0 - I have tried many solutions and nonwork.
I am using expo and npm to start a new project, both tabs and blank template have the react-navigation npm install issue:
expo init
? Choose a template: expo-template-tabs
? Choose which workflow to use: managed
✔ Please enter a few initial configuration values.
Read more: https://docs.expo.io/versions/latest/workflow/configuration · 100% completed
? Yarn v1.13.0 found. Use Yarn to install dependencies? No
[08:18:30] Extracting project files...
[08:18:31] Customizing project...
[08:18:31] Initialized a git repository.
[08:18:31] Installing dependencies...
npm WARN deprecated kleur#2.0.2: Please upgrade to kleur#3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/#react-navigation%2fnative - Not Found
npm ERR! 404
npm ERR! 404 '#react-navigation/native#3.1.4' is not in the npm registry.
npm ERR! 404 Your package name is not valid, because
npm ERR! 404 1. name can only contain URL-friendly characters
npm ERR! 404 It was specified as a dependency of 'react-navigation'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ddcjosiahl/.npm/_logs/2019-02-08T13_18_47_333Z-debug.log
[08:18:47] Process exited with non-zero code: 1
[08:18:47] Set EXPO_DEBUG=true in your env to view the stack trace.
I am trying options with no luck:
Cleared NPM cache
Tried Yarn
Install expo cli again
npm install --save react-navigation ... react-native, native, etc
npm install --save react-navigation
npm ERR! code E404
npm ERR! 404 Not Found: #react-navigation/native#3.1.4
Note: I have spent all day yesterday trying to get new projects to work. I did manage to get passed it by installing different versions of react-native, and cannot replicate...which then caused a mismatch of versions and app wouldn't load:*
****RNGestureHandlerButton:****
enter image description here
Why is react-navigation#^3.0.0 needing native#3.1.4 and how to solve?
Thanks!
Solved by editing root .npmrc file confirming I had:
registry=https://registry.npmjs.org/
My issue was related to having "_auth=".
Both npm and yarn now work with react-navigation and 404's I was getting.
Thanks #Munishkin & #Atin Singh
I had the same issue while upgrading from expo v31 to v32. Tried all what you have done with no luck. Finally, installing from github with npm install https://github.com/react-navigation/react-navigation-native solved the issue for me. I then installed react-navigation package separately and then all other required modules for my project.
I don't have the clear idea to what your exact problem is. So, I am assuming that you're not able to use React-navigation with expo.
Try using yarn for the whole process instead of npm.
Use yarn when expo asks to make a new project and then to install react-navigation use-
yarn add react-navigation
I used navigation yesterday and it worked perfectly for me.
This is weird, 'cause I just tried and it fetches react-navigation with all dependencies nicely. Actually if you load https://registry.npmjs.org/#react-navigation%2fnative url directly in your browser you should see the corresponding JSON schema. If it gives you 404 you might want to troubleshoot your DNS resolvers.

Resources