Module not found: Can't resolve 'react-avatar' - html

I am having a MERN website with 2 folders in the Github repo, client and backend. When I am turning on the react server the output page is showing an error as
Failed to compile
./src/components/Student/Student.jsx
Module not found: Can't resolve 'react-avatar' in '/MernCrudApp/client/src/components/Student'
This error occurred during the build time and cannot be dismissed.
To reproduce this error please follow the following steps.
Clone the repo
Go into the backend folder and write npm install in the terminal and then npm run start, and then enter the client folder and repeat the commands respectively.

There is no 'react-avatar' package in your client's package.json.
npm install react-package in this folder and you should be good.

Related

Qwik not generating a manifest file for SSG site

I am trying to get started with Qwik and SSG.
I have run the following commands in this order
npm create qwik#latest
selected the basic app
npm run qwik add static-node
npm run build.static
npm run ssg
After doing this I get the following error message:
Missing client manifest, loading symbols in the client might 404
Any ideas, I have gone through the SSG documentation but nothing points me in the right direction
need to run npm run build to bundle client dist and generate its manifest

I am getting an error while deploying my app to azure through git repository

This is the message I am getting Log stream from Azure
This is my package.json
I see that you have an error in your Azure log of Local package.json exists, but node_modules missing. When you set your deployment script, did you remember to run npm install? The deployment on azure is running npm start but has not installed the node modules so you need to install them as well.

Puppeteer error: "failed to launch the browser process"

I am trying to run Puppeteer on my new laptop. However, I am getting this error:
node:8144) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/mnt/c/Users/juliu/repos/kmj-sniper/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory
What am I missing here?
The error message can either indicate that your operating system is missing the ATK library (libatk), or that this shared library is installed in a location that Puppeteer does not know about, because it is not available from the paths specified in the environment variable LD_LIBRARY_PATH, or has a different name from what is expected.
If the ATK library is missing, what platform your laptop is running will likely determine the answer. If you are running Ubuntu, for example, you could do the following, or similar:
$ sudo apt-get install libatk-bridge2.0-0
On CentOS/RHL, perhaps:
$ sudo yum install atk.x86_64
If the required package is already installed, however, check that LD_LIBRARY_PATH includes the directory where the shared library is installed, and that the filename matches that shown in the error message returned by Puppeteer.
Delete folder node_modules (don't delete the package.json and package-lock.json files) and then run npm i.
It will essentially reinstall all your dependencies.
If that doesn’t work, then try Alex's answer.

npm start not working for react while install react script (react script : 3.4.0 version)

I am new to React js, While using npm start after install the react not working,I tried every process but no use. Thanks in advance
Error
cricdost#0.1.0 start C:\xampp\htdocs\cd-web
react-scripts start
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"webpack": "4.41.2"
Don't try to install it manually: your package manager does it automatically.
However, a different version of webpack was detected higher up in the tree:
C:\xampp\htdocs\node_modules\webpack (version: 4.39.2)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact order:
Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
Delete node_modules in your project folder.
Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.
Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
Check if C:\xampp\htdocs\node_modules\webpack is outside your project directory.
For example, you might have accidentally installed something in your home folder.
Try running npm ls webpack in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed webpack.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.
P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cricdost#0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cricdost#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:
npm ERR! C:\Users\XSC-10261\AppData\Roaming\npm-cache_logs\2020-02-20T04_56_31_650Z-debug.log
I had faced the same error. The solution that I found is to do the step-6 as described in Error message. That is to delete "webpack" folder of node_module folder under your root projects directory. For example
Assume that you installed "npm install create-react-app" in D:\Projects folder.
And then you ran "npx create-react-app firstproject" in D:\Projects folder. So, your actual react project folder is "D:\Projects\firstproject".
So, what I want to tell is don't delete "webpack" folder in "D:\Projects\firstproject\node_module" directory. Instead, delete "webpack" folder in "D:\Projects\node_module" directory.
And then, you can run "npm start" command in your actual react project directory "D:\Projects\firstproject".
I hope, this will work for you.

Error while installing nodeJS mysql package on Windows 7

I am new to nodeJS,
I am trying to install mysql package of nodeJS as
>node
>npm install mysql
and also with
>npm install node-mysql
but getting error as
npm should be run out side of the node repl in your normal shell
so i run the same command in side nodeJS directory in program file
still getting error check images
This error is indicating that the path referred to in the screenshot above (.../AppData/Roaming/npm) is not available (doesn't exist or isn't accessible by your user).
Can you make sure there is a folder npm at this path:
c:\Users\mayank.bhadauria\appdata\roaming
If not, please create it and then try npm install node-mysql again.