Until yesterday, I was able to download @angular/common/http package. However starting from today, every time I issue
npm i
command, I get the following error:
npm ERR! code EINVALIDPACKAGENAME npm ERR! Invalid package name "@angular/common/http": name can only contain URL- friendly characters
People have suggested to upgrade/downgrade npm which I have tried but no luck so far.
package.json
"dependencies": {
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/common/http": "^5.0.0",
Any ideas guys? let me know if you need more info.
Thanks
Angular, the Angular CLI, and Angular applications depend on npm packages for many features and functions. To download and install npm packages, you need an npm package manager. This guide uses the npm client command line interface, which is installed with Node.js by default.
Libraries are published as npm packages, usually together with schematics that integrate them with the Angular CLI. To integrate reusable library code into an application, you need to install the package and import the provided functionality in the location you use it.
The @angular/common/http
module is part of the @angular/common
module. You only need to include @angular/common
within your dependencies, not the http module as well.
Adding @angular/common/http
to your package json will try to include it a second time when you already have it. Remove it, delete your node_modules folder and rerun npm install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With