I need to downgrade my angular cli from version 9 to version 8. I have tried the following:
npm uninstall -g #angular/cli
npm cache verify
npm install -g #angular/cli#8.x.x
whenever I reinstall it and run ng --version it will still output version 9 packages:
Node: 14.3.0
OS: darwin x64
Angular: 9.1.9
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.901.7
#angular-devkit/build-angular 0.901.7
#angular-devkit/build-optimizer 0.901.7
#angular-devkit/build-webpack 0.901.7
#angular-devkit/core 7.3.9
#angular-devkit/schematics 7.3.9
#angular/cli 9.1.7
#ngtools/webpack 9.1.7
#schematics/angular 9.1.7
#schematics/update 0.901.7
rxjs 6.5.5
typescript 3.8.3
webpack 4.42.0
I really need to roll back to version 8 to fix a breaking change, but am unable to get anything to change from version 9. Running ng serve with version 9 won't compile the app. Is there something I'm missing?
EDIT: I figured out that I had somehow installed a different version of the cli specific to the project that I was working in. I uninstalled both the local cli and the glocal cli and reran npm install -g #angular/cli#8.x.x. The ng --version output is correct now but when I try to run ng serve I get the following error: Cannot determine versions of "#angular/cli".
This likely means your local installation is broken. Please reinstall your packages.
this worked for me:
ng --version
npm uninstall -g #angular/cli
npm cache clean --force
npm install -g #angular/cli#8
ng --version
Related
My versions are
Angular CLI: 9.1.13
Node: 16.16.0
OS: win32 x64
I ran
npm install -g #angular/cli
and
ng --version
commands but I am getting errors in the version of package of angular project
Package Version
------------------------------------------------------#angular-devkit/architect <error>
#angular-devkit/core <error>
#angular-devkit/schematics <error>
#schematics/angular <error>
#schematics/update <error>
I even tried all these commands
npm uninstall -g #angular/cli
npm install -g npm#6.14.12
I am new to angular, it was working initially and I created some sample projects, real fun!! Then I tried to clone a project and ran npm install and since I have not been able to run (serve) any previous projects or create new ones.
When creating new projects it throws the following error:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for #angular/cli#~0.0.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'hello-world'
npm ERR! notarget
I installed angular using npm install -g #angular/cli#latest
Checked the version ng --version shows
Angular CLI: local (v0.0.0, branch: master)
Node: 12.13.1
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
#angular-devkit/architect <error>
#angular-devkit/core <error>
#angular-devkit/schematics <error>
#schematics/angular <error>
#schematics/update <error>
I've tried various suggestion I found
uninstalling module
clearing cache (--force) etc
or updating version as suggested here https://www.npmjs.com/package/#angular/cli#updating-angular-cli
Nothing has worked so far
I must have missed something … as the previous projects show the correct version of angular/cli when I ran ng --version
Angular CLI: local (v0.0.0, branch: master)
Node: 12.13.1
OS: win32 x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.803.19
#angular-devkit/build-angular 0.803.19
#angular-devkit/build-optimizer 0.803.19
#angular-devkit/build-webpack 0.803.19
#angular-devkit/core 8.3.19
#angular-devkit/schematics 8.3.19
#angular/cdk 8.2.3
#angular/cli 8.3.19
#angular/material 8.2.3
#ngtools/webpack 8.3.19
#schematics/angular 8.3.19
#schematics/update 0.803.19
rxjs 6.4.0
typescript 3.5.3
webpack 4.39.2
I have Nodejs already installed on my machine. Here are the steps that I followed to attempt to reproduce:
Installed the Angular CLI by running
npm install -g #angular/cli#latest
Checked Angular version by running ng --version which gave me the following:
Angular CLI: 8.3.19
Node: 10.15.3
Cloned an example Angular project. I used this one: https://github.com/DeborahK/Angular-GettingStarted
In the new directory, I ran the following:
npm install && npm update
And finally, I ran ng serve which successfully initiated my web application and hosted on localhost:4200
I would suggest removing the currently installed Angular package on your machine (global location and local location). Then reinstall Angular and try once more.
Make sure you don't have the old CLI package installed, run:
npm uninstall -g angular-cli
npm uninstall -g #angular/cli
Then run:
npm install -g #angular/cli
I need the drag and drop capabilities from the #angular/material module, but when I install it using angular cli, a bunch of vulnerabilities come out of the audit. The program works, but if I try to run npm audit fix, there is an error that the angular cli compiler module is not found.
How do I properly fix the vulnerabilities? npm update did not work.
Here's the output of ng --version:
Angular CLI: 7.2.4
Node: 10.16.1
OS: linux x64
Angular: 7.2.15
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.12.4
#angular-devkit/build-angular 0.12.4
#angular-devkit/build-optimizer 0.12.4
#angular-devkit/build-webpack 0.12.4
#angular-devkit/core 7.2.4
#angular-devkit/schematics 7.2.4
#angular/cdk 8.1.2
#angular/cli 7.2.4
#angular/material 8.1.2
#ngtools/webpack 7.2.4
#schematics/angular 7.2.4
#schematics/update 0.12.4
rxjs 6.3.3
typescript 3.2.4
webpack 4.28.4
Here's what npm install in my project returns, apart from a few not installed peer dependencies:
audited 41915 packages in 5.767s
found 596 vulnerabilities (1 low, 2 moderate, 593 high)
run `npm audit fix` to fix them, or `npm audit` for details
The audit refers to angular cli, build-angular and so on - so all kinds of different packages.
You seem to be on an older version of Angular. Update to the latest version of Angular (you may have to update some code, particularly if you use lazily loaded modules), starting with the CLI. You can then use ng update followed by the packages you wish to update: http://angular.io/cli/update
Instead of npm install try npm install -d and try ng update to update angular version
This will not install npm globally. Then also there will be errors but when you run the project it will be work fine.
I tried to install bootstrap in my Angular Project by
npm install --g bootstrap
but i am getting following warning
npm WARN bootstrap#4.2.1 requires a peer of jquery#1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap#4.2.1 requires a peer of popper.js#^1.14.6 but none
is installed. You must install peer dependencies yourself.
I am using following version of ng and npm
Angular CLI: 7.1.4
Node: 10.15.0
OS: win32 x64
Angular: 7.1.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.11.4
#angular-devkit/build-angular 0.11.4
#angular-devkit/build-optimizer 0.11.4
#angular-devkit/build-webpack 0.11.4
#angular-devkit/core 7.1.4
#angular-devkit/schematics 7.1.4
#ngtools/webpack 7.1.4
#schematics/angular 7.1.4
#schematics/update 0.11.4
rxjs 6.3.3
typescript 3.1.6
webpack 4.23.1
Just do as it says:
npm i jquery#1.9.1 --save
the option --save is to save this dependency to your project.
I had the same problem and this is the solution:
npm install bootstrap jquery popper.js --save
The system automatically resolves the references for you.
This worked for me -
npm i -g npm#3.10.10
npm installation:
$npm install bootstrap
$npm install bootstrap jquery popper.js --save
then
import to the react folder(index.js):
import 'bootstrap';
import 'bootstrap/dist/css/bootstrap.min.css';
I resolved the above issue by running the npm command
npm install --save bootstrap
If you are using Angular, you don't need those dependencies of jquery etc.
Angular is responsible for rendering and manipulating the DOM and if you’re interfering with it using jQuery, you might get some unwanted results.
In your package.json file
search for "dependencies" and editing it to show as
"dependencies": {
//same lib
"jquery": "^1.9.1",
},
or run this command from cmd
npm i jquery#1.9.1 --save
you are installing bootstrap globally .you need to first open your project file after that go to cmd and install the bootstrap and jquery because the compiler didn't understand that where we have to install.
the code is for installing bootstrap and jquery is
PS E:\web\Angular\Angular program\my-first-project> npm install bootstrap#3 jquery --save
then it will download and check-in your package.json file its display the version of your software
I have resolved jQuery dependency with following steps in my react development project
npm install react-bootstrap bootstrap --save
npm audit fix --force
Result: found 0 vulnerabilities
It also fixes the issue, if another dependency is having issues.
I've installed node from https://nodejs.org/en/download and then I installed angular CLI via NPM using
npm install -g #angular/cli
After it's done, I then try to create a new angular project
ng new new-project
And I get the following error
Error: You provided an invalid object where a stream was expected.
You can provide an Observable, Promise, Array, or Iterable.
You provided an invalid object where a stream was expected.
You can provide an Observable, Promise, Array, or Iterable.
I've tried installing the cli using sudo (and without) and I've reinstalled node: I always get the same error.
I can't find anything about anyone having this issue.
I'm using MacOS.
Try to use an older version of Angular CLI until this problem get solved.
You can follow this issue in https://github.com/angular/angular-cli/issues/9172.
EDIT: I found a solution, run these commands:
npm un -g #angular/cli
npm cache clean --force
npm i -g #angular/cli
It worked for me.
I follow the steps
Update Node, npm latest version
Remove angular-cli 1.6.3
Install angular-cli 1.5
I could create application, component and others
updated 12-JAN
I update angular-cli up 1.6.4, Node up 9.4.0 and worked fine for me to create new project
Issue has been fixed.
Remove node_modules and run npm install to get the latest dependencies.
Confirmed issue on:
Angular CLI: 1.6.3
Node: 6.10.3
OS: win32 x64
Angular CLI: 1.6.3
Node: 6.10.3
OS: linux x64
Angular CLI: 1.6.4
Node: 8.0.0
OS: win32 x64
In each cases i'm using nvm.
Works after uninstalling and specifically installing angular cli version 1.5.5
Follow this issues in https://github.com/angular/angular-cli/issues/9187
Install in your project
npm install #angular-devkit/schematics
ng -v
Angular CLI: 1.6.3
Node: 9.2.0
OS: linux x64
Angular: 5.2.0