I've scoured the internet for an answer to this, and haven't found anything yet that works. I'm new to using React, but my friend asked for help with some CSS so I cloned his React project from github (the React app is successfully online and he can work on it locally). Repo is here: https://github.com/brandonkun5/TrueAlpha
When I ran npm start, it told me I had no module 'react-scripts', so I ran npm install react-scripts
Now, when I run npm start, I get the following message:
internal/modules/cjs/loader.js:638
throw err;
Error: Cannot find module './common'
So far, I've tried:
npm del package.json
npm del node_modules
npm install
Moving the folder into a different location
Searching the code for 'Require ('common')" and 'Require ('./common')
Updating to the last node version
and nothing has worked yet. Any ideas on what could be causing this error?
The file common.js is missing in node_modules/debug/src/common.js. I copied it from another React project of mine and run npm start in the console and then it worked. Try to copy that file from the path above to same path in this project and it should work. Second option is to run "npm install debug" and file will installed and debug folder will be updated.
Related
I installed the latest nodejs 19.2.0 on my windows 11 OS rather than the recommended for most users 18.12.1
npx create-react-app my-first-app works just fine, it creates all the files and folders without any errors, shows happy hacking message as well, recommends to use npm start command. I go inside my-first-app folder, go npm start and I get a module not found error...like this picture
Error Message Screenshot
In youtube tutorials, there is no any error in their pc. npm start runs just as easily as npx create-react-app <anyappname>.
F:\Tutorial & Practice\Frontend development\React Projects\my-first-app. With this path to your project, I can see there is an & symbol in the Tutorial & Practice directory. Sometimes that might cause error. Try renaming the directory without any symbols or even spaces, just to be sure. Then run npm start. And if that still doesn't work delete the node_modules folder and then npm install again and see if that works.
Try this first:
npm install react-scripts
If the error wasn't solved, then try this:
rm -rf node_modules
npm cache clean -f
npm install
npm install react-scripts
I have just tried to view an old application of mine using npm start but it wont load keep getting the error.
Cannot find module 'C:\Users\Team Knowhow\development\Punk-API\node_modules\react-scripts\bin\react-scripts.js.
I tried creating a new react app and NPM start works fine so have no idea what the issue is with my old react app and why NPM start does not work.
Have you installed dependencies first using npm install.
If done already, try removing node_modules folder and installing dependencies again.
Make sure you have installed all dependencies including react-scripts!
You've to ensure that all the dependencies that your application is using is mentioned in the correct manner with their correct version in your pacakage.json file. And if that looks alright then run
npm i
or
npm install
This command will download all the dependencies that are mentioned in your package.json file.
I have an existing Vue project and I want to add Boostrap into it. I ran this command (following this tutorial)
npm install bootstrap jquery popper.js
And then, I got an error in the Vue project.
./node_modules/core-js/modules/es.array.iterator.js module build failed: error: enoent: no such file or directory
I have tried deleting node_modules folder and package-lock.json then running npm install, but it didn't work. I also have tried to clear cache but it didn't work. I also have tried running npm install from my cmd but it didn't work as well.
Any other suggestions? Thanks!
Which version of vue are you using (2, 3)? Have you considered using Bootstrap Vue?
I just did the same method a few hours later and it succeeded. I think probably it also depends on your Internet connection.
I was installing node by using the command on cmd npm install and I got following message
enter image description here
Please help me that how I can solve this issue.
npm stands for node package manager which is used to install external packages or npm modules or libraries hosted on NPM. To get started with a Node JS Project you will need index.js and hit npm init, this will initialise your Node JS Project with auto genreated package.json.
Majorly Node JS, React JS or Angular contains following files:
index.js/server.js(Entry File)
package.json (modules/packages/libraries used in project and script can be written to run your project in different envs)
node_modules (which is auto generated and contains all installed modules listed in package.json)
According to your error message you don't have a package.json file so you need to initialize npm before installing node in your directory.
Initialize it with npm init.
Npm documentation
Step 1- First install Node from https://nodejs.org/en/download/.
Step 2- Now go to your project file cd project.
Step 3- Type the command npm init in console.
Step 5- Now you can see package.json file in your project.
Finish- Now you can install any package by using "npm install packageName" command.
I have recently been getting off the ground with Meteor and React. I followed the tutorial on the Meteor website with no problem.
Then I tried creating another project, trying to follow another tutorial (for an older version of Meteor). Somewhere along the line, Meteor started throwing up obscure errors. After trying to start fresh again, I ended up reinstalling Meteor and it stopped complaining.
However, I'm getting the same problems, again. Specifically, after creating a brand new project:
meteor create myproject
cd myproject
meteor
The server throws up the following error:
[...]
W20161109-03:53:42.862(1)? (STDERR) Error: The babel-runtime npm package could not be found in your node_modules
W20161109-03:53:42.862(1)? (STDERR) directory. Please run the following command to install it:
W20161109-03:53:42.863(1)? (STDERR)
W20161109-03:53:42.863(1)? (STDERR) meteor npm install --save babel-runtime
[...]
I do what I'm told and attempt to install babel-runtime package. The server manages to successfully get off the ground, but it then throws up the following error at run-time:
Uncaught Error: Cannot find module 'babel-runtime/helpers/slicedToArray'
at Function.require.resolve
This is all still working off a freshly created project, with no extra packages installed or code changed. I have tried looking online for solutions but, while there are lots of references to bugs that have been fixed, I haven't found anything. A couple of (questions)[Babel - Error: Cannot find module 'babel-runtime/helpers/typeof' on StackOverflow have suggested the following:
Reinstalling the NPM modules
rm -rf node_modules
meteor npm install
Updating NPM
meteor npm update -g npm
I am using Meteor 1.4.2, NPM 3.10.9, Ubuntu 16.04.1.
I was having the same issue. After a little digging, found this: https://github.com/meteor/meteor/issues/8019
* Installing the `babel-runtime` npm package in your application
`node_modules` directory is now required for most Babel-transformed code
to work, as the Meteor `babel-runtime` package no longer attempts to
provide custom implementations of Babel helper functions.
Consider trying it out by using the latest release candidate (not officially released yet):
meteor update --release 1.4.2.1-rc.1
And then:
meteor npm install --save babel-runtime
After upgrading to 1.4.2.1-rc.1 (and then subsequently upgrading to 1.4.2.1 this morning 11/9), the error was resolved.
Try adding package.json file inside your project directory and then run
meteor
npm install --save babel-runtime
in the command line.
You may have whitespace in your project name. All that you have to do is create another project without whitespace in the name. I know that it's quite difficult to detect the cause from the error message, but it is what it is.
I recently faced this issue with meteor 1.11.1 and the solutions here did not work. Turns out I had whitespaces in my project name (Ghughu Server V2) and all I had to do is create another one without the spaces (GhughuServerV2).
P.S. It works fine even if you have whitespace in the path to your project, you just can't have whitespace in the project name. Also, just renaming the directory doesn't work. Either you have to create a brand new project or change some configuration inside (which seems impractical if you're working in a newly created project).