I try to run npm run-script build on my project after downloading git and node and it says that it cannot find module when the module is there in the folder, package.lock file includes react scripts as well. I am new to react and just starting out if anyone has experiences this issue before how did you manage to solve?
image description
Related
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'm a beginner. I'm studying bootstrap, but when i'm trying install bootstrap via nodejs, the terminal annouced to me installing was successed, but node js don't create the node moduel folder in my project, so where is the node moduel folder? And how to create the node moduel in my project??
My english english!, i'm so sorry because of that
anyone can help me pls!
enter image description here
I would suggest creating a package.json file to keep track of the dependencies that you install.
even after running npm install bootstrap it shows a warning to create the package.json file. and bunch of other warnings about peer dependencies needed for the bootstrap such as jquery.
One of the reason that your node_module is missing might be the version of the NodeJS that you are using.
Other one can be running out of resources to needed to complete the installation such as RAM. there is something similar here.
I'm trying to build a react app, which is built from the ground up. I use Yarn as my package manager. Whenever I try to run my node server I'm getting the error "Module not found express". which I did install and is a part of my dependencies.
I found out that the module express is being fetched from a node_modules directory instead of the local app directory, is this the issue?
error description
The module is being fetched from here:
"C:/Users/hp/AppData/Local/Microsoft/TypeScript/4.2/node_modules/#types/express/index"
Thanks in advance :)
EDIT
NPM global screenshots
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'm working on an app that both has a website (React) and mobile app (React Native). In one repository I have my web, mobile and redux files which is my local module/package (so that they can be shared). I have not had any problems with installing my local package when working on web. However with React Native I am running into issues with the package.
I ran
npm install --save '../store/sagas
Which gave me
Unable to resolve "redux-saga-store/sagas/index.js" from "App.js"
Fair. App.js is where I am calling my rootSaga via
import rootSaga from 'redux-saga-store/sagas/index.js';
Which is identical to how web is calling the same file.
I checked my node_modules and the package and all the expected files are there. I tried
npm list
Which returned (as expected)
redux-saga-store#1.0.0 -> /Users/{myname}/Repos/{repositoryname}/shared/store
I have triple-checked the paths and they are correct.
I tried npm install with the global flag. I went on to nuking my node_modules and package-lock.json so I could try re-installing. I created a brand new react-native app using create-react-native-app which also did not fix the issue. I would really appreciate any suggestions or help