I try to deploy my react app in AWS Amplify but i have this problem during the build :
2021-02-14T09:27:15.885Z [INFO]: Creating an optimized production build...
2021-02-14T09:27:17.657Z [INFO]: Failed to compile.
2021-02-14T09:27:17.662Z [INFO]: ./src/App.js
Cannot find module: '#material-ui/core/Grid'. Make sure this package is installed.
You can install this package by running: yarn add #material-ui/core/Grid.
2021-02-14T09:27:17.702Z [WARNING]: error Command failed with exit code 1.
2021-02-14T09:27:17.703Z [INFO]: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2021-02-14T09:27:17.708Z [ERROR]: !!! Build failed
2021-02-14T09:27:17.708Z [ERROR]: !!! Non-Zero Exit Code detected
The component '#material-ui/core/Grid' could not be found, i try to make a local build of the same code succesfully and i don't know why i have this in AWS.
My dependencies in package.json :
"material-ui": "^0.20.2",
"material-ui-core": "^5.0.1"
I really can't find any error on my code, so what is the problem ?
Thanks in advance
I solve the problem by using
yarn add #material-ui/core
maybe it's different from using
yarn add #material-ui-core
Related
[webpack-cli] You need to install 'webpack-dev-server' for running 'webpack serve'.
Error: Cannot find module 'ajv/dist/compile/codegen'
I getting error like this when give npm start in React Application.
Have you checked in your package.json to see if it has been installed? It is common to mispell something on install and have a different package installed. Here is a similar thread
webpack-dev-server isn't working in my project
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 created a React app by Yarn, but when I tried to start I got this error below. This is happening with all my applications.
yarn start
yarn run v1.22.17
warning ../package.json: No license field
$ react-scripts start
node:internal/modules/cjs/loader:488
throw e;
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /home/barry/state/node_modules/postcss-safe-parser/node_modules/postcss/package.json
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:416:9)
at packageExportsResolve (node:internal/modules/esm/resolve:669:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/barry/state/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Node.js v17.0.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I've tried npm i web-vitals --save-dev and yarn add -D web-vitals but it does not work anymore.
I've tried yarn add -g web-vitals too.
There is an ongoing issue related to Create React App and builds with Node v17.
See create-react-app #11565
Try node --version to see which version of node you are using. If it is a v17+, then you are likely hitting this bug.
To get around the issue, you can use a version of Node < v17, delete node_modules folder and the lockfile of whichever system you're using — yarn.lock or package-lock.json — then reinstall dependencies.
try:
yarn upgrade
fixed the bug for me, and React App started working.
I am using Azure static Web Apps to host my React website.
And I keep facing the error below.
yarn run v1.22.10
$ react-scripts build
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.
Failed to compile.
I have tried npx browserslist#latest --update-db for several times but it keep send run failed message to me.
and here is the entire error image
for all who are facing this problem ,
checkout this post Browserslist: caniuse-lite is outdated #1184
using npm i npm-update-all -g to update all outdated files can solve this issue
I have same problem in my Vue App.And in my case,yarn upgrade helps a lot.
In my case cleaning node_modules folder and reinstalling the packages helped:
# From the root of the repo
rm -rf node_modules
npx browserslist#latest --update-db
If you have multiple package.json files in the repository, check out how to clean all node_modules recursively
I am trying to create react app using: npx create-react-app my-app
and I keep getting this error:
Creating a new React app in /Users/mcohen/Git/andys-tale/andys-blog.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.12.3
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
error https://registry.yarnpkg.com/#xtuc/ieee754/-/ieee754-1.2.0.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "Unexpected end of data"
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /Users/mcohen/Git/andys-tale/andys-blog has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting andys-blog/ from /Users/mcohen/Git/andys-tale
Done.
Any suggestions what shall I do?
Delete yarn.lock file
This will help!
I'd probably desperately run yarn cache clean