Metro Bundler error in installing own npm package - javascript

I have created this npm package. After installing it in another app and running it, I get the error:
Metro Bundler has encountered an internal error
This happens even if the project is a newly initialised one. What is wrong in my npm package?

Probably because in your index.js file you have
import App from "./src/App";
but there is no such file in your repo.

Related

Angular custom npm package 'Cannot find module'

I have created a custom npm package library, I have successfully created it and published on npm and then installed the package using npm install <my-package-name>.
And now I am facing issue on importing the package.When I import it in app.module.ts file its shows:
Cannot find module 'my-module-name' or its corresponding type declarations.
I have also tried by deleting the node-modules and package-lock.json files and then npm install but sadly it's not works.

React Native Navigator

I created a basic react native app just to practice.
As a first step, I followed the docs below to create a navigation from one page to another:
https://reactnative.dev/docs/navigation
I'm using React Native CLI, and installed:
npm install #react-navigation/native #react-navigation/native-stack
npm install react-native-screens react-native-safe-area-context
and I copied the code from the docs to my App.js file. When I'm hitting npx react-native run-android, I'm getting the following error:
error: Error: Unable to resolve module react-navigation from C:\Users\sh\NewProject\App.js: react-navigation could not be found within the project or in these directories:
node_modules
I tried to delete node_modules and did npm install - didn't help.
Any idea how to resolve this? thanks
This error comes when library is not linked up or properly not imported. Please uninstall and try to install it again step by step.

Getting error in react after installing fontawesome through npm

i have installed fontawesome by following these steps by visiting their website.
npm i --save #fortawesome/fontawesome-svg-core
npm install --save #fortawesome/free-solid-svg-icons
npm install --save #fortawesome/react-fontawesome
and now am getting this error
./node_modules/react-scripts/node_modules/#pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js
Error: ENOENT: no such file or directory, open 'C:\Users\HP\Desktop\practice site\javascript\REACT\Codingworld\node_modules\react-scripts\node_modules#pmmmwh\react-refresh-webpack-plugin\lib\runtime\RefreshUtils.js'
Help me to solve my error
Please try this one. I hope to solve it. if it solves please comment on my answer.
install font-awesome for react
The error message says that it's looking for a file RefreshUtils.js in the directory C:\Users\HP\Desktop\practice site\javascript\REACT\Codingworld\node_modules\react-scripts\node_modules#pmmmwh\react-refresh-webpack-plugin\lib\runtime but doesn't find it.
This file is part of the npm package #pmmmwh/react-refresh-webpack-plugin.
It could be that you previously installed this package, or that this package is a dependency for another package you're using (e.g. react-scripts).
Your question doesn't include sufficient information, such as the content of your package.json file, and specifying which command is giving the error.
There could be various reasons causing the error:
Running the command from the wrong folder
In this case, navigate to the correct folder in your terminal, then run the command.
Issues in your dependencies
In this case, given that you have a package.json file in your project folder, reinstall all your dependencies:
Delete the node_modules folder and the package-lock.json file
Run npm cache clean
Run npm install
Given that you're running the command from the correct folder and your dependencies are up-to-date, the error should go away.

Some of the globally installed npm packages are not working

I have npm installed globally and whenever I run npm -v to check its version, it displays it correctly which is currently 7.13.0.
I also have heroku-cli installed globally but whenever I run heroku --version it says:
C:\Users\MyName\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found
Inside C:\Users\MyName\AppData\Roaming\npm I have heroku and npm both installed globally but whenever I run a heroku command it fails to run. I am unable to figure out the issue.
Below I have attached the screenshot of my globally installed packages directory.
Maybe your npm's directory path configuration might have some error.
You can modify path by following steps.
Open or create a ~/.profile file and add your npm path
export PATH=C:\Users\MyName\AppData\Roaming\npm/node_modules/node/bin
On the command line, update your system variables:
source ~/.profile
Or else, I recommend changing the npm's default directory which is explained on npm official docs.(https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally). I also had similar issue and followed same instructions.

Aurelia Babel unknown option base.modules error

I downloaded the skeleton project from the Aurelia docs and tried starting it up by using the command:
gulp watch
However, I get the following error:
[09:48:13] gulp-notify: [Error running Gulp] Error: [BABEL] <filelocation>: Unknown option: base.modules
Is there a fix for this?
did you follow the full project setup instructions on the docs page or in the project's readme.md?
Running The App
To run the app, follow these steps.
Ensure that NodeJS is installed. This provides the platform on which the build tooling runs.
From the project folder, execute the following command:
npm install
Ensure that Gulp is installed globally. If you need to install it, use the following command:
npm install -g gulp
Ensure that jspm is installed globally. If you need to install it, use the following command:
npm install -g jspm
Install the client-side dependencies with jspm:
jspm install -y
To run the app, execute the following command:
gulp watch
Browse to http://localhost:9000 to see the app. You can make changes in the code found under src and the
browser should auto-refresh itself as you save files.
I read over one step, which was the npm install command which you have to execute from the project folder. I got some errors that the CL.exe file was missing and after some Googling, I found out that was due to me not having Visual Studio 2013 not installed, which kept the utf-8 validator package from not installing.

Categories