Help! I have no idea what is going on here, create react app is not working I have also tried reinstalling and yet to no avail, please help!
Npm version: 5.4.2
Node version: 8.70
Tried the npm install --save --save-exact --loglevel error react react-dom react-scripts
In my case, "create-react-app" was not installed. to install run this command
npm install -g create-react-app
Once installation successful, try running
npx create-react-app hello-world
If this works for you. Great else comment what worked for you,
Please try this:
npm cache clean --force
I also got the same issue and tried to resolve for a long and finally resolved using this command,
npx create-react-app#latest my-app --use-npm
I had the same problem and had to do the following:
npm uninstall -g create-react-app
npm uninstall create-react-app
After this I was able to create the app with:
npx create-react-app project-app
I had the same problem, and I solved it by:
1. update the npm version (npm install npm#latest -g)
2. clear the cache (npm cache clean --force)
3. create the react project (npx create-react-app todo)
(create-react-app was already installed)
I had similar issue while tried creating new react app with create-react-app, but related to some random JSON reading issues while installations like.. >= 5.0 || 4.0 ..
But the fix below solves multiple and similar issues.
First of all, make sure you have required or latest version of node installed.
npm install npm#latest -g
Before using create-react-app make sure you clean npm cache using npm cache clean --force
Now, is should be fine to create new react app with npx create-react-app tl-app or npx create-react-app . if you want to create current directory as project root.
Make sure you are not running any antivirus, stop/pause all antivirus or protection software.
You can also try
use create-react-app projectname --save
or create-react-app projectname --save-exact and start again
OR
as the error suggests, you should use a newer version of node. You are using 8.9.4, you should probably use 8.12.0 LTS.
It sets up your development environment so that you can use the latest JavaScript features, provides a nice developer experience, and optimizes your app for production.
You’ll need to have Node >= 8.10 and npm >= 5.6 on your machine. To create a project, run:
npx create-react-app my-app
cd my-app
npm start
Note:
npx on the first line is not a typo — it’s a package runner tool that comes with npm 5.2+.
Create react app provides more information regarding this.
It may be the problem of cache also, so can also try:
npm cache clean --force
Edit 1: This may be due to slow internet speed, Please check the
internet and try again.
npx create-react-app .
( the .) means create project on this folder so you should manually create if you do that
For the windows machine following command worked for me
yarn create react-app my-app
cd my-app
yarn set version berry
yarn
yarn start
The problem on my machine was caused by yarn. I am windows 10 and after uninstalling yarn using npm uninstall -g yarn, my script run correctly. So
Open terminal and type: npm uninstall -g yarn
Once done, close terminal and open new one
type create-react-app (app name) and this should create your app :)
Please note that the above steps assume that you already have node and react-cli installed on your machine.
on Ubuntu 18.04
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
What I did, is going to
C:\Users\mycomputerName\AppData\Roaming\npm\
I changed the name of this file
create-react-app.ps1
to
create-react-appOld.ps1
or you can delete it, then it worked fine
Tried all the above methods but no luck:(
Step1 : Reinstalled Node js
Step2 : Check whether environment variables has been created. if not create one for nodejs,npm and composer
Step3: Also add "C:\Windows\System32" to the global PATH environment variable.
Step4: Then use "npx create-react-app my-app" to create react project
Step5: Run the commmand : cd my-app and npm start
Step6: It will work
I finally got it to work. An anti-virus in my system was causing it not to work property. I unistalled it and it's working as expected.
After no luck with updating my npm version and doing npm cache clean --force I ended up just doing a fresh install of node which fixed the issue for me.
HAD the same problem. Running Node with cra. installed cra -g for starters.
npm install -g create-react-app
then downgraded react-scripts to version 2.1.8
npm install react-scripts#2.1.8
created a .env file in root directory and added this to it.
DB_HOST=localhost
DB_USER=root
DB_PASS=s1mpl3
SKIP_PREFLIGHT_CHECK=true
Then you do the typical delete node_modules folder and the package-lock.json file.(NOT PACKAGE.JSON!!!)
then:
npm install
npm start
This worked for me. Sorry I'm not more informative on why this worked for me. I'm still trying to understand why it didn't work in the first place.
I just did it now after messing around with it all yesterday.
Installed react globally like people have said.
then I used 'git bash here' to open terminal in the directory i want
oddly, it worked when I removed npm. I know it's weird, I've never had to do that and it makes no sense but its working so:
create-react-app my-app-name
I'm on windows 10 by the way.
If there is anyone having this issue that you can not find your project when you
yarn create-react-app (name of project)
npx create-react-app (name of project)
then just be sure that you are in the right directory.
use this command in your terminal
cd ..
now search the project name by
cd (project name)
you should find your directory here.
Please do this, I hope it will fix all of your problems
1- npm i -g create-react-app
2- create-react-app my-app
Find the folder and where a folder named npm is present and add it into environment variables (path)
I also experienced the same problem and SOLVED IT.
This is what I did.
Restart your machine(computer)
Deactivate your anti-virus. I chose the "permanently" option
Open the terminal and run the "create-react-app" command again, It will definitely do the trick.
Activate your anti-virus
And get working :-)
Related
I cloned a react application onto my system and ran following commands
npm install -g create-react-app
npm install --save react react-dom
After that i ran
npm start
But it threw the above mentioned error, It is working fine on my other system from which i pushed it on github. But it is not working on any other system after cloning whether windows or mac.
Check if node_modules directory exists. After a fresh clone, there will very likely be no node_modules (since these are .gitignore'd).
Solution
run npm install (or yarn) to ensure all deps are downloaded.
Alternative Solution
If node_modules exists, remove it with rm -rf node_modules and then run npm install (or yarn).
Tried all of the above and nothing worked so I used npm i react-scripts and it worked
I had similar issue. In my case it helped to have Yarn installed and first execute the command
yarn
and then execute the command
yarn start
That could work for you too if the project that you cloned have the yarn.lock file. Hope it helps!
In package.json, I changed
"start": "react-scripts start"
to
"start": "NODE_ENV=production node_modules/react-scripts/bin/react-scripts.js start"
I hope this solves the problem for some people. Although the other solutions above seem not to work for me.
you should not install react-scripts globally, for me this fixed the problem:
npm install --save react react-dom react-scripts
if this still dont work :
update to latest npm version : npm install -g npm#latest
delete node_modules directory
reinstall all dependencies : npm install
https://github.com/facebookincubator/create-react-app
npm install -g create-react-app
create-react-app my-app
cd my-app/
npm start
You install the create-react-app package globally.
After that you run it and create a project called my-app.
Enter your project folder and then run npm start. If that doesn't work try running npm install and then npm start. If that doesn't work as well, try updating your node version and/or npm.
I had this problem for ages and I eventually found my solution by sheer chance.
Turns out, you can't have spaces or wacky characters in any folder names.
e.g.
~/projects/tutorial/ReactJS/JavaScript Framework: ReactJS/app-name
won't work because JavaScript Framework: ReactJS contains spaces.
In general, it's probably not great practice to be using spaces in folder/file names anyway but I hope this saves someone at least 4 hours of trial and error.
Also, any non-alphanumeric characters should be avoided.
This error occurs when you Install package with npm install instead of yarn install or vice-versa.
using npm i --legacy-peer-deps worked for me.
I do not know specifically which operation out of the following it performed:
Installing the peer dependencies' latest stable version.
Installing the peer dependencies' version which the core dependy you are installing uses.
But I think it performs the latter operation. Feel free to let me know if I'm wrong ^-^
npm install --save react react-dom react-scripts
Above command worked for me.
This boggles me time to time when I have a fresh start with create-react-app, please make sure your NODE_ENV variable is set to development not production, as devDependencies in your package.json will not be installed by npm install.
If you are having this issue in a Docker container just make sure that node_modules are not added in the .dockerignore file.
I had the same issue sh1 : react scripts not found. For me this was the solution
Just ran into this problem after installing material-ui.
Solved it by simply running npm install again.
Just doing an Yarn install solved the problem for me
Deleting package-lock.json and node_modules then npm install worked for me.
If none of the other answers work properly (after updating the npm etc). I would strongly recommend you to install the project on your desktop.
create-react-app project_name
The solution that worked for me is below. Try creating React app with this command.
create-react-app react-app --scripts-version 1.1.5
this worked for me.
if you're using yarn:
delete yarn.lock
run yarn
and then yarn start
if you're using npm:
delete package-lock.json
run npm install
and then npm start
If anyone still have this problem after trying these solutions: check your project path as node has some issues working with spaced dir names. I changed all directories names that had spaces in their names and it worked perfectly.
solution idea taken from: https://npm.community/t/react-scripts-not-found/8574
i am using yarn BTW
You shoundt use neither SPACES neither some Special Caracters in you path, like for example using "&". I my case I was using this path: "D:\P&D\mern" and because of this "&" I lost 50 minutes trying to solve the problem! :/
Living and Learning!
If you have tried everything and nothing solved it, try to rename the directories name. react will not start if the folder's name contains uppercase letters.
After spending too much time trying all the solutions above, I can say for sure:
If you ran into this issue, check your path. If the path contains any special character or spaces just rename it and make sure that the new path doesn't have any spaces or special character. Then run it again .
delete node_modules
run npm install
after that run npm start
if above does't work
delete node_modules
delete package-lock.json
run npm install
and then npm start
if above solutions does not fixed your problem, try the following this worked for me:
if you want to start on another port or PORT command not found error then do the following steps:
open package.json file
inside script replace the start command with below
"start": "set PORT=3006 && react-scripts start"
To change the port of your app, you can also create a new file name .env in the root directory of the project and write in it PORT=3006 (then save the file). Now run your app using npm start.
I just randomly experienced this "react-scripts: command not found" error after issuing a react-scripts build request, which was previously working just fine.
A simple reboot of my system corrected the issue.
if anyone is willing to use npm only, then run this npm i react-native-scripts --save, then npm start or whatever the command you use
solution 1:
delete the package-lock.json file and then type -> npm install
solution 2:
/Users/piyushbajpai/.npm/_logs/2019-03-11T11_53_27_970Z-debug.log
like this is my debug path --> so this you will find in the console -> press on command and click on the link, you will find error line;
like this:
verbose stack Error: nest_form#0.1.0 start: react-scripts start
solution 3:
delete the node_module and npm i with fresh way.
solution 4:
go to node_module and delete jses folder and delete it, then do npm i and again start with npm start
I had issues with latest version of yarn 1.15.1-1
I've fixed it by downgrading to lower version sudo apt-get install yarn=1.12.3-1
I ran into this error after renaming the directory with the #/ symbol on macOS to match the name of my NPM package namespace.
When the NPM command looked for installed packages in my local node_modules, it couldn't find it due to the way macOS was rewriting the directory path. After renaming the directory without #/ I was up and running again.
Just You have to restore packages to solve this issue,
So just run command :
npm install or yarn install
I tried every answer but cleaning my npm cache worked..
steps:
Clean cache =====> npm cache clean force.
reinstall create-react-app =====> npm install create-react-app.
npm install.
npm start !!!
Every time I try to run npx create-react-app my-app, the same error will show:
A template was not provided. This is likely because you're using an outdated version of create-react-app. Please note that global installs of create-react-app are no longer supported. You can fix this by running npm uninstall -g create-react-app or yarn global remove create-react-app before using create-react-app again.
I did whatever this error said. Try using another text editor rather than VSCode and try all of the ways that people suggested in related topics, but nothing works.
check whether create-react-app has been uninstalled by typing which create-react-app, if it is not uninstalled it will exit the create-react-app folder located ex : /usr/bin/create-react-app. then delete with rm /usr/bin/create-react-app
It is maybe because you are not using the latest create-react-app version.
If you are using npm 5.1 or earlier, you can't use npx. Instead, install create-react-app globally:
npm install -g create-react-app
then run:
npx create-react-app my-app
See all information here.
Hope this answers helps you.
When I type the create-react-app my-app command in my terminal, it appears to work - downloading all libraries successfully etc. At the end of that process however I get a message that a template was not provided.
Input
user#users-MacBook-Pro-2 Desktop% create-react-app my-app
Output
Creating a new React app in /Users/user/Desktop/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
..... nothing out of the ordinary here .....
✨ Done in 27.28s.
A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported.
In package.json of my-app:
"dependencies": {
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.3.0" <-- up-to-date
}
I checked out the CRA changelog and it looks like support was added for custom templates - however it doesn't look like the command create-react-app my-app would have changed.
Any idea what is going on here?
If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version.
Docs
Use either one of the below commands:
npx create-react-app my-app
npm init react-app my-app
yarn create react-app my-app
if npm uninstall -g create-react-app stated above does not work.
Type which create-react-app to know where it is installed. Mine was installed in /usr/bin folder. Then do sudo rm -rf /usr/bin/create-react-app. (Credit to #v42 comment below)
1)
npm uninstall -g create-react-app
or
yarn global remove create-react-app
2)
There seems to be a bug where create-react-app isn't properly uninstalled and using one of the new commands lead to:
A template was not provided. This is likely because you're using an
outdated version of create-react-app.
After uninstalling it with npm uninstall -g create-react-app, check whether you still have it "installed" with which create-react-app (Windows: where create-react-app) on your command line. If it returns something (e.g. /usr/local/bin/create-react-app), then do a rm -rf /usr/local/bin/create-react-app to delete manually.
3)
Then one of these ways:
npx create-react-app my-app
npm init react-app my-app
yarn create react-app my-app
Though already lots of answer is here.
I came up with 3 solutions which I applied step by step when I faced this situation.
First step: From Official manual,
If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version.
https://create-react-app.dev/docs/getting-started
You can use these commands below:
npx create-react-app my-app
npm init react-app my-app
yarn create react-app my-app
Second step (If first one doesn't work):
Sometimes it may keep caches.then you can use these commands given below.
npm uninstall -g create-react-app
npm cache clean --force
npm cache verify
yarn create react-app my-app
Third step:(If these 2 won't work)
first uninstall via npm uninstall -g create-react-app,then check if you still have it "installed" with which create-react-app command on your command line. If you got something like (/usr/local/bin/create-react-app) then run this rm -rf /usr/local/bin/create-react-app (folder may vary) to delete manually.
Then again install it via npx/npm/yarn.
NB: I succeed in the last step.
First uninstall create-react-app globally by this command:
npm uninstall -g create-react-app
then in your project directory:
npm install create-react-app#latest
finally:
npx create-react-app my-app
To add up more to the answers above:
With the new release of create-react-app, you can create a new app using custom templates.
Two templates available so far:
cra-template
cra-template-typescript
Usage:
npx create-react-app my-app [--template typescript]
More details of the latest changes in create-react-app:
https://github.com/facebook/create-react-app/releases/tag/v3.3.0
I too had the same problem. When I trid the npm init react-app my-app command returned the same message
A template was not provided. This is likely because you're using an
outdated version of create-react-app.
But
yarn create react-app my-app command works fine.
Clear your npm cache first then use yarn as follows:
npm cache clean --force
npm cache verify
yarn create react-app my-app
I hope this helps.
EDIT
...you might want to try the following after I have looked into this problem further:
npm uninstall -g create-react-app
yarn global remove create-react-app
which create-react-app - If it returns something (e.g. /usr/local/bin/create-react-app), then do a rm -rf /usr/local/bin/create-react-app to delete manually.
npm cache clean --force
npm cache verify
npx create-react-app#latest
These steps should remove globally installed create-react-app installs, you then manually remove the old directories linked to the old globally installed create-react-app scripts. It's then a good idea to clear your npm cache to ensure your not using any old cached versions of create-react-app. Lastly create a new reactjs app with the #latest option like so: npx create-react-app#latest. There has been much confusion on this issue where no template is created when using npx create-react-app, if you follow the steps I have stated above (1-6) then I hope you'll have success.
p.s.
If I wanted to then create a react app in a directory called client then I would type the following command into the terminal:
npx create-react-app#latest ./client
Good luck.
npm install -g create-react-app in your pc
create react project again with npx create-react-app my-app
This worked for me.
npm uninstall -g create-react-app
npx create-react-app my-app
So I've gone through all the steps here, but non helped.
TLDR; run npx --ignore-existing create-react-app
I am on a Mac with Mojave 10.15.2
CRA was not installed globally - didn't find it in /usr/local/lib/node_modules or /usr/local/bin either.
Then I came across this comment on CRA's github issues. Running the command with the --ignore-existing flag helped.
These two steps worked for me
1) Uninstalled react-app globally with this command
npm uninstall -g create-react-app
2) Installed react-app in project folder with this command
npx create-react-app project-name
npx create-react-app#latest your-project-name
work for me after trying all the answers hope that can help someone in the future.
"If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version"
This is reported at https://create-react-app.dev/docs/getting-started/. For me, this did not work. I had to re-install create-react-app globally instead.
My steps to fix this problem were to:
npm uninstall -g create-react-app
npm install -g create-react-app
npx create-react-app my-app
All of the option didn't work for me on MacOS. What did work was the following 3 steps:
Delete the node from: /usr/local/bin/
then
install node newly: https://nodejs.org/en/
then
Install react: npx create-react-app my-app follow: https://create-react-app.dev/
For Linux this worked for me
sudo npm uninstall -g create-react-app
npx create-react-app my-test-app
TLDR: Uninstall the global package using npm uninstall -g create-react-app and generate new react apps using npx create-react-app app.
Issue
You're using an older version of create-react-app that you have installed globally using npm. The create-react-app command invokes this global package.
You could've confirmed that you were using an outdated version by running npm outdated -g create-react-app or comparing create-react-app --version with npm view create-react-app.
The fact that the version of react-scripts was up to date, has nothing to do with the version of the package that is bootstrapping the app (create-react-app), which grabs the latest versions of the packages that it uses (react-scripts in this case).
Solution
If you want to continue using the create-react-app command, you'll need to update the global package using npm update -g create-react-app. Note that you'll want to do this periodically to keep it up to date. You'll notice that create-react-app does not recommend this (noted in the logs from your install).
A better approach would be to delete the global install entirely (npm uninstall -g create-react-app) and instead use npx so that it grabs the latest version of the package every time (more detail on npx below).
You should confirm that it was uninstalled globally by trying to use create-react-app to make sure the command is "not found".
Issues with uninstalling?
You can debug where it was installed using which create-react-app. If you're having issues uninstalling it, you may have multiple versions of node/npm on your machine (from multiple installs, or because you use a node version manager such as nvm). This is a separate issue I won't address here, but there's some info in this answer.
A quick nuclear approach would be to forcefully remove it (rm -rf) at the path that which create-react-app returns.
Supplement
Global npm packages and the npx command
$ NPM_PACKAGE_NAME will always use the globally installed version of the package, regardless of which directory you're in.
$ npx NPM_PACKAGE_NAME will use the first version of the package that it finds when searching up from the current directory to the root:
If you have the package in your current directory, it will use that.
Else if you have the package in a directory that is a parent of your current directory, it will use the first one it finds.
Else if you have the package installed globally, it will use that.
Else if you don't have the package at all, it will temporarily install it, use it, and then discard it. - this is the best way to ensure the package is up to date.
More info about npx can be found in this answer.
Using npx with create-react-app
create-react-app has some special commands/aliases to create a react app (instead of npx) that are specific to that package (yarn create react-app, npm init react-app), but npx create-react-app will work the same as it does with other packages.
yarn vs npm global installs
Yarn stores global installs in a different folder than npm, which is why yarn create react-app would work immediately without uninstalling the global npm package (as far as yarn is concerned, the package hasn't been installed).
This is just a temporary solution though, as you'll need to remember to always use yarn instead of npm when using Create React App.
This works for me!
1) npm uninstall -g create-react-app
2) npm install -g create-react-app
3) npx create-react-app app_name
If you have any previously installed create-react-app globally via npm install -g create-react-app, Better to uninstall it using npm uninstall -g create-react-app
This solved my problem
Steps:
1.Uninstall the create-react app
npm uninstall -g create-react-app
2.Now just use
npx create-react-app my-app
this will automatically create the template for u .
This problem is not solved like this, the problem is in the different instances of node, try removing globally create-react-app and then delete the node_modules and package-lock.json from your root user
This work's for me :
Let's, uninstall create-react-app globally by this command:
npm uninstall -g create-react-app
After that in your project directory:
npm install create-react-app#latest
At the last:
npx create-react-app my-app
For typescript :
npx create-react-app my-app --template typescript
First uninstall create-react-app
npm uninstall -g create-react-app
Then run yarn create react-app my-app or npx create-react-app my-app
then running yarn create react-app my-app or npx create-react-app my-app may still gives the error,
A template was not provided. This is likely because you're using an outdated version of create-react-app.Please note that global installs of create-react-app are no longer supported.
This may happens because of the cashes. So next run
npm cache clean --force
then run
npm cache verify
Now its all clear. Now run
yarn create react-app my-app or npx create-react-app my-app
Now you will get what you expected!
I fix this issue on Mac by uninstalling create-react-app from global npm lib, that's basically what said, just try to do, you need also do sudo:
sudo npm uninstall -g create-react-app
Then simply run:
npx create-react-app my-app-name
Now should be all good and get the folder structures as below:
Using the command npm uninstall -g create-react-app didn't work for me.
But this worked:
yarn global remove create-react-app
and then:
npx create-react-app my-app
Such a weird problem because this worked for me yesterday and I came across the same error this morning. Based on the release notes, a new feature was added to support templates so it looks like a few parts have changed in the command line (for example, the --typescript was deprecated in favor of using --template typescript)
I did manage to get it all working by doing the following:
Uninstall global create-react-app npm uninstall create-react-app -g.
Verify npm cache npm cache verify.
Close terminal. I use the mac terminal, if using an IDE maybe close and re-open.
Re-open terminal, browse to where you want your project and run create-react-app via npx using the new template command conventions. For getting it to work, I used the typescript my-app from the documentation site to ensure consistency: npx create-react-app my-app --template typescript
If it works, you should see multiple installs: one for react-scripts and one for the template. The error message should also no longer appear.
npm uninstall -g create-react-app could be an answer in some cases, but not in mine.
You should manually delete your create-react-app located at ~/.node/bin/ or /usr/bin/ (just type which create-react-app and remove it from locations you saw using rm -rf), next just run npm i -g create-react-app.
After that create-react-app will be working correctly.
This worked for me
1.First uninstall create-react-app globally by this command:
npm uninstall -g create-react-app
If there you still have the previous installation please delete the folder called my app completely.(Make sure no program is using that folder including your terminal or cmd promt)
2.then in your project directory:
npm install create-react-app#latest
3.finally:
npx create-react-app my-app
For any Windows users still having this issue, this is what fixed it for me:
Run where create-react-app to get the path (mine was in C:\Users\username\AppData\Local\Yarn\bin).
Navigate to that directory and delete both "create-react-app" and "create-react-app.cmd".
Navigate to the directory you want to start a project in.
Run npm install create-react-app,
npx create-react-app name-of-app,
cd name-of-app, yarn start.
Step #4 will vary based on your configuration, but that's just what got me up and running.
One of the easiest way to do it is by using
npx --ignore-existing create-react-app [project name]
This will remove the old cached version of create-react-app and then get the new version to create the project.
Note: Adding the name of the project is important as just ignoring the existing create-react-app version is stale and the changes in your machines global env is temporary and hence later just using npx create-react-app [project name] will not provide the desired result.
npx create-react-app#latest {project name}
this seems to be the way to make it work.
After using this command:
yarn global upgrade create-react-app
I then tried:
yarn create-react-app my-app but it didn't work for me.
This worked though:
npx create-react-app my-app
i have installed CRA for over a month and have been working with it without having any problems, however today i created a new react app and it builds the folders and directories except it doesn't generate src and public folder(it just generated node-modules folder) thus when i run npm start it gives me an error saying:
npm ERR! missing script: start
Initially you might have installed create-react-app globally.Try to remove using npm uninstall -g create-react-app command and then try npx create-react-app <your-app-name>.
The reason is, npx should use it's latest version to work. Hope your doubt is now cleared
I still have no idea what was the reason but I got it working doing these:
-uninstalled create-react-appusing npm uninstall -g create-react-app.
-using npx create-react-app app-name I created a new app and now it's working as expected.
I have tried installing in different computers and for most cases the above codes helped to fix the issue. But in a rare case I had to use another code and it worked perfectly. Try running the below code
npx --ignore-existing create-react-app Your-AppName
I tried all the suggestions stated above but none works for me.I just run these commands and create a new project.
npm rm -g create-react-app
npm install -g create-react-app
npx create-react-app#latest my-app
This work for me.
You can create project with yarn:
yarn create-react-app my-app
I'm new to Ionic. I was following the Ionic documentation "get started", created a project sample named "super". The problem is that when I run the command line ionic serve in the project directory, it threw an error Error: Cannot find module '#ionic/app-scripts'
Try installing app-script from npm
npm i #ionic/app-scripts
To get the latest #ionic/app-scripts, run the following command:
npm install #ionic/app-scripts#latest --save-dev
app-scripts currently compatible with node 6 and 7.
İf you installed node 8, then please uninstall and install node 6 stable version.
This solved error and now i can use ionic 3, angular 4 .
Take care!
do not downgrade the node version, update the version of "app-scripts":
To get the latest #ionic/app-scripts, please run:
npm install #ionic/app-scripts#latest --save-dev
I was facing same issue, here is what I did-
Removed node_modules from directory (Manually).
open project dir
run this command-
npm install
That fixed those errors for me.
See here.
I had this issue , i solved it by deleting node_modules/ folder and ran the command npm installnow my app works
I tried every non-downgrade solution mentioned in this thread, in all kinds of ways and none of them worked. With nothing left to lose, I went down the downgrade route (I used sudo apt-get purge --auto-remove nodejs to remove previous 8.x version and then installed the last stable ver on the 6.x branch using the nodesource ppa).
Still got the same errors trying to run in the original project folders, but then I created a new project and ionic serve worked just fine in that space.
FWIW, I did not need to run npm update or npm i #ionic/app-scripts afterwards, but I did find it necessary to adopt the habit of running commands with sudo in front (or you sudo -s into root account).
I ran into the same issue and i had problems fixing it. However i update my app scripts npm install -g #ionic/app-scripts#latest --save-dev to the latest version and my problem was solved
npm install -g #ionic/app-scripts#latest --save-dev
Error: app-script not found/ app-script not installed/ app-script module is not found
Try this work for me, Your also:
- npm cache clean --force
- npm install #ionic/app-scripts#latest --save-dev
- npm install -g #angular/cli
I had the issue, solved by execute cnpm i #ionic/app-scripts.
Just open a new terminal window/session. I could not figure it out, but it's probably related to env.
None of the options worked for me.
But I could make it work by updating node with
npm update
After this, the problem was solved and the application started.
Good Luck.
I had the same problem and here is what worked for me
I was trying to run the program using VSCode terminal, Instead I used the windows cmd and it ran perfectly. I think the error is in VSCode terminal, it cannot identify the app-scripts module inside the project. Maybe it will be fixed in a later update.
Delete node_modules and package-lock.json
rm -rf node_modules package-lock.json
npm install
Reference:
https://github.com/ionic-team/ionic-cli/issues/3399
After half a day trying to solve this
And after:
python version error
node-sass misconfiguration error
I did the following
Remove node-modules folder
Run "npm audit fix --force"
Downgrade webpack installation "npm uninstall webpack && install webpack#3.12.0"
The last one because ionic build was giving me an error on that package after the audit
In my case, I need to set NODE_ENV to production then it installs successfully
set NODE_ENV=production
npm install #ionic/app-scripts#latest --save-dev
You must create the project as administrator if you have mac or linux uses sudo, if you have windows run the console as administrator and create the project
My issue was solved after run this script:
npm i #ionic/app-scripts