I looked for other questions available on stack but was not able to find ans related to this issue.
I have just started Angular and installed things as asked on Udemy course. Creating app and then starting with ng serve.
While I am running ng serve, I am getting below error.
After running npm install I am getting below message.
Can you please guide me to solve this error ?
Thank you very much in advance. :)
well try this one it works for me: npm install --save-dev #angular-devkit/build-angular
If the error message persists after installing packages, it may be due to the NPM settings. In recent versions of the package manager, by default it only installs the packages needed for the production version of the project. The "build-angular" package is a development dependency. If you want to make the website work, you have to tell NPM to install the development packages, by adding the "--only" option with the "dev" version so you should use this command instead:npm i --only=dev
Thank you for above answers.
With below steps followed including avoiding few mistakes, I was able to make it work.
Installed packages in C drive instead of my application folder.
Deleted my old app and recreated it from scratch.
And then when I gave "ng serve" it ran fine.
Related
I was following a tutorial on Udemy in order to setup a NestJS app from scratch. Upon execution using npx ts-node-dev src/main.ts I get the error [PackageLoader] No driver (HTTP) has been selected. In order to take advantage of the default driver, please, ensure to install the "#nestjs/platform-express" package ($ npm install #nestjs/platform-express).
I tried uninstalling and reinstalling #nestjs/platform-express but I still get same error.
Finally solved this issue, I had to delete the entire node_modules folder and then run npm install with the same pckage.json file.
In my Angular project, I was having errors while trying to build a docker image. I used ng update #angular/cli #angular/core and was able to resolve that error, and now I'm able to create a docker container of my project that is served.
However, now I cannot serve my project with ng serve because I get the following error:
An unhandled exception occurred: compiler.getInfrastructureLogger is not a function
getInfrastructureLogger is NOT a function I created, I'm assuming it's coming from a node mod. I've tried deleting the node_mod folder and install them again with npm install, but I still get the same error. I've tried cleaning my npm cache and I still get the error.
I went back a couple of commits (to before I ran ng update #angular/cli #angular/core) and then I'm able to run ng serve with no errors, but am then unable to create my docker images. I need to be able to use containers, so I have to use ng update #angular/cli #angular/core. But I also want to be able to serve my project as a standalone (plus it better for developing).
Does anyone have any advise on this error? Where it's coming from? Solutions?
I would really appreciate it. Thanks for any help you can give.
***To specify, I used ng update #angular/cli #angular/core --force it was the only for me to run that command.
My project is Angular 8, node node version 12.14.
The update in angular versions or one of the dependencies caused this error. We could help more if we knew what version of Angular you were coming from and what version you were updating to.
First, if you're upgrading to the latest stable Angular version (8.x), make sure you have node 10.9 or later installed.
Regardless, the Angular Upgrade Guide is an awesome tool that allows you to input the version you're coming from and the version you're going to and it will give you step-by-step instructions as to what you need to do in order to upgrade your angular app. Try upgrading one major version at a time following these instructions. It almost always resolves my problems.
Please note: It's better to upgrade one version at a time
When I try to create the starter React tutorial app using powershell, I get the below error:
"You are using npm 2.15.12 so the project will be boostrapped with an old unsupported version of tools".
"Please update to npm 3 or higher for a better, fully supported experience".
However, my NPM version is 6.11.3 as seen below.
What I have tried:
I have ran powershell as admin as answered in this question and restart.
I have also uninstalled and reinstalled Nodejs completely.
So after an extra hour digging around, I saw a few posts with similar (but not exactly) the same issue. I decided to install Yarn and install with that.
After install, I ran yarn cache clean and ran npx create-react-app your-app and it worked. Sorry for bothering you all.
I had the same problem. I'm running WSL with ubuntu, and yarn cache clear didn't work, but I noticed a node modules directory created in the project. I think it was messing with the node version so I deleted it. It worked
I'm brand new to React Native, I wanted to install an UI toolkit to simplify my UI design process so I went ahead and installed #shoutem/ui. After the installation I ran my application and I got a dependency error:
I went ahead and installed string_decoder (npm install --save string_decoder) so it now shows as a module under my node_modules folder but I still get the same error.
I tried to troubleshoot this by following the steps the error message shows, still getting it. Any suggestions on this?
Maybe, it' from packager cache. start packager with this command:
npm start --reset-cache
React Native v40 had some breaking changes which caused Shoutem UI toolkit not to work. It will be solved in the following days. In the meantime, here is a temporary solution.
Im very very new in NodeJS
I want to ask about installing and using it in my Project..
I've installed nodejs in my Windows, but I have no idea how to make it works in my Cordova/Phonegap Project. I want to install this module in my project node-gcm. it said I just have to execute npm install node-gcm --save but I dont know where should I execute that command so I tried executed it on my project root (/www). After that I tried the example application code to use it but It said that require is not defined. Can anyone tell me how to fix this?
You need to learn nodejs properly to use in your project. I would recommend the below site could be a good starting point for you which covers all the basics.
http://www.tutorialspoint.com/nodejs/
You are getting that error because, when you look at the package.json file of the node-gcm package, you will notice the dependencies mentioned as,
If you are a windows user, you need to get into your node_modules directory by giving cd node_modules command in your command line and then just issue this command npm install which will install all the required packages.
Hope this helps!.