angular : changing a file sends error and should restart 'npm' - node.js

When I change a file in my angular application it sends error:
ERROR in ./src/app/#theme/components/auth/index.js Module build
failed: Error: ENOENT: no such file or directory, open
'C:\Dev\Ng\ngx-admin\src\app\#theme\components\auth\index.js' i 「wdm」:
Failed to compile.
And when I terminate the ng serve and re run, it is correct.
I dont want to re run it again.
What should I do to fix it?

Angular CLI cannot actually see files that you add when the server is running.
So it is better to give a fresh build by command.
CTRL C
ng serve -o
A similar question was asked here it will help to solve your doubt:
Source File Not Found in Angular CLI project

Related

Can't create a react native empty project, app.json not found

I am currently trying to get started with react native.
I set up the development environment referring to the documentation, but can't even pass the first step and create an empty project.
I am on Windows 11, Node 16.15.1, and NPM 8.12.2
I keep getting the following error when trying to init react-ative project with expo init awesomeProject
Error downloading and extracting template package: Error: npm exited with non-zero code: 1
× Something went wrong while downloading and extracting the template.
Can't read JSON file: D:\crna\awesomeProject\app.json
└─ Cause: Error: ENOENT: no such file or directory, open 'D:\crna\awesomeProject\app.json'
Does anyone has a suggestion ?
Don't really know what is the problem but i found a soluion that might help other people in the same situation as me! like said here just run in CMD instead of GitBash
Use sudo if on linux. And maybe Admin on windows.

how to fix "Error: Cannot find module '/home/container/index.js'", I've tried everything

So the host that I use for my discord bot died so I downloaded all the code and tried hosting it on my PC. But I get the following error.
Error: Cannot find module '/home/container/index.js
I've tried everything I can:
updated nodejs
reinstalled all my packages
Changed package.json
How can I fix this?
Cannot find module means you are trying to run non-existent file.
Ensure there is index.js in your working directory. If not,
Use cd to go to the directory where it is (usually it's src near the package.json)
Run node ./index.js
Many time people have just the problem of command line to run file,
as windows and linux have
different syntax to run .js file
i.e. node ./index.js for linux
and node .\index.js for windows

How I i solve Build Failed on Azure Devops Pipeline when building a node application

I have been studying azure devops in the past weeek and i have been trying to deoploy my first node app on azure but i keep running on an error of build failed. and the error is
Error Cannot find module './routes/hostelRoutes' so i have checked and confirmed that the module is available because everything runs on my local machine. Below is a pic where i get the error
According to the error message:
Error Cannot find module './routes/hostelRoutes'
The ‘node_modules’ folder could have some issues.
You could try to remove the directory ‘/node_modules/’ and re-install the folder.
Please refer to the following command line script about removing and re-installing.
cd Project_folder
rm -rf node_modules
npm install
You could check this ticket How do I resolve “Cannot find module” error using Node.js? for some information

npm install creating files at wrong directory for electron

When I install sqlite3by npm in directory of electron project,
it creates
c:\testing\Elektron\node_modules\sqlite3\lib\binding\node-v57-win32-x64
but electron aplication throw following error:
Error: Cannot find module 'c:\testing\Elektron\node_modules\sqlite3\lib\binding\electron-v1.6-win32-x64\node_sqlite3.node'
I tried to rename the directory, but it lead to
Error: A dynamic link library (DLL) initialization routine failed.
Here is the pastebing of all commands and actions I did
I don't need work arounds, I need to build aplication later into an executable file, so I appreciate your answer.
electron-rebuild
is needed for native modules.

add.import() adding some contents with my path

I recently started on ember JS.
I am trying to import bootstrap.css file from "node_modules\bootstrap\dist\css\bootstrap.css"
But when i run the server its shows error like
Error: ENOENT: no such file or directory, open 'E:\For Saving\ember\project2\new_project\tmp\simple_concat-input_base_path-JBlVqJm6.tmp\node_modules\bootstrap\dist\css\bootstrap.css'
It is adding some path with my path and giving me this error. I search a lot to solve this but i can't. And Also i installed the bower via npm and the bower_component is not getting added into my project folder.
Last thing I am not good with command Line Interface. can i run ember without terminal?
You can't app.import node modules files. It's only for bower components and vendor folder.
Reference from ember-cli documentation.

Resources