4

When I'm going to create new angular project using . This error occurred. Could you guys please, tell me how to solve this issue.

e$ ng new angular-the-basics
  create angular-the-basics/e2e/app.e2e-spec.ts (300 bytes)
  create angular-the-basics/e2e/app.po.ts (208 bytes)
  create angular-the-basics/e2e/tsconfig.e2e.json (235 bytes)
  create angular-the-basics/karma.conf.js (923 bytes)
  create angular-the-basics/package.json (1302 bytes)
  create angular-the-basics/protractor.conf.js (722 bytes)
  create angular-the-basics/README.md (1032 bytes)

  create angular-the-basics/src/app/app.component.css (0 bytes)
Installing packages for tooling via npm.
npm WARN deprecated nodemailer@2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated uws@9.14.0: stop using this version

npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: httpntlm@1.6.1 (node_modules\httpntlm):
npm WARN network SKIPPING OPTIONAL DEPENDENCY: request to https://registry.npmjs.org/httpntlm/-/httpntlm-1.6.1.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: escodegen@1.9.1 (node_modules\escodegen):
npm WARN network SKIPPING OPTIONAL DEPENDENCY: request to https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: uglify-to-browserify@1.0.2 (node_modules\uglify-to-browserify):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: Cannot cd into 'D:\Git\angular-project\angular-the-basics\node_modules\.staging\uglify-to-browserify-f9ddd93a'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: degenerator@1.0.4 (node_modules\degenerator):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: Cannot cd into 'D:\Git\angular-project\angular-the-basics\node_modules\.staging\degenerator-b0b187d9'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: optionator@0.8.2 (node_modules\optionator):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: Cannot cd into 'D:\Git\angular-project\angular-the-basics\node_modules\.staging\optionator-d20f57c5'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: pac-resolver@3.0.0 (node_modules\pac-resolver):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: Cannot cd into 'D:\Git\angular-project\angular-the-basics\node_modules\.staging\pac-resolver-ce15981e'

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lilan\AppData\Roaming\npm-cache\_logs\2018-05-21T07_33_59_772Z-debug.log
Package install failed, see above.
Package install failed, see above.

node -v

v9.4.0

npm -v

5.6.0

ng -v

Angular CLI: 1.6.6 OS: win32 x64

Lilanka
  • 79
  • 1
  • 2
  • 9
  • try again after running command `npm cache clean -f` – Pardeep Jain May 21 '18 at 07:55
  • I tried it. but it is not worked. – Lilanka May 21 '18 at 08:16
  • are you behind some corporate proxy server ? – user1608841 May 21 '18 at 08:22
  • no. Now I upgraded npm version to v6.0.1 also. but same error occurred – Lilanka May 21 '18 at 08:24
  • `npm WARN deprecated nodemailer@2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/ npm WARN deprecated mailcomposer@4.0.1: This project is unmaintained npm WARN deprecated socks@1.1.9: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0 npm WARN deprecated uws@9.14.0: stop using this version npm WARN deprecated node-uuid@1.4.8: Use uuid module instead npm WARN deprecated buildmail@4.0.1: This project is unmaintained` – Lilanka May 21 '18 at 08:43
  • Can you run this in PowerShell and post the results here: `Test-NetConnection -ComputerName registry.npmjs.org -Port 80` – CodeWalker Sep 18 '19 at 07:30

24 Answers24

7

npm cache clean --force when its complete you can then run npm install

user10414033
  • 71
  • 1
  • 5
6

if you using mac then use

rm package-lock.json

and for window user use

del package-lock.json

After that just run

npm install

hope will help.good luck

anil soni
  • 75
  • 1
  • 4
6

I don't know especially if it will fix your problem but you can try this, It worked for me:

  1. Delete manually directory npm and npm-cache in ...AppData/Roaming
  2. Run in your terminal npm cache clean --force
  3. Install your package npm install -g @angular/cli

Good work =)

j3ff
  • 5,719
  • 8
  • 38
  • 51
Aymen
  • 96
  • 1
  • 2
2

use the following commands at your terminal: -delete node modules and package-lock.json

  1. yarn install or npm install
  2. npm start
Bansi29
  • 1,053
  • 6
  • 24
2

My error was : npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\SHILPA\AppData\Roaming\npm-cache_logs\2020-12-28T22_23_22_383Z-debug.log

Solution:

  1. delete your npm and npm-cache from your Roaming directory or any where it is present
  2. Then go to your vs code or terminal and be on the folder which you are creating the project like (my app). Enter this command npm install npm@latest -g
  3. and now run npx create-react-app ./ OR npx create-react-app my-app

Happy Hacking!!!!!

2

Create a new folder----> npm install ------>If errr comes again delete node module half downloaded folder and try---->(npm cache clean --force)------>npm install OR npm install -g @angular/cli

Shiv kumar K
  • 159
  • 8
1

npm cache clean --force simply add this command in your command line and then start your work. Its worked for me.

1

Yes, I also got same issue while creating angular app through cmd. But in my case , Internet is not stable while creating app. After getting this issue , I deleted previous app and again create new app with proper internet connection. Then new app will be created

Priyanka Jadhav
  • 181
  • 1
  • 3
1

I followed these steps:

  1. delete nodemodules and package-lock.json
  2. Run this command npm cache clean --force
  3. then go to npm-cache (path is shown in your error statement) and then delete that directory.
  4. install latest version on npm.
  5. then npm install and npm start

If any error again comes then check which package is throwing error then change the version of that package (version shown in the console error) in package.json. Then npm install and npm start. Then you wile fine.

0

First, you need to clear the npm cache. Run this command to clear npm cache npm cache clean --force Then reinstall the npm using npm install Now run your project using npm start or something else based on the framework you are using. Thank you!

0

listed below some steps solved this error

1-> open the your project folder in your editor

2-> Right click of the your project and select "Open In Terminal"

3-> Display the your path in console then type npm start

your project development start in browser

Thank You...

0

Same problem i tried sudo npm start it worked....

0

Delete this folder "npm-cache" path:C:\NODEJS\npm-cache then create one folder inside C:\ open command prompt C:\angular> here angular is my folder name then install packages npm install @angular/cli -g then later ng new Hello Hello is my project name

0

if your on linux or unix like os , then this is because you have to run this command under root privileges like this -

sudo npm install yourpackage
Dharman
  • 30,962
  • 25
  • 85
  • 135
Vedant Nandwana
  • 75
  • 1
  • 2
  • 6
0

I was also struggling for a few minutes with this problem but later what I noticed was I was not inside my project folder and was forcibly trying to run the project outside the project folder. Make sure you are inside your project folder and run the commands.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Badal S
  • 507
  • 1
  • 3
  • 20
0

A complete log of this run can be found in: npm ERR! C:\Users\jems bond\AppData\Roaming\npm-cache_logs\2021-03-27T14_40_47_500Z-debug.log Package install failed, see above.

this same error occurs for me, so I solved the following ways:

step-1} delete your npm-cache folder from your Roaming directory like:

C:\Users\jems bond\AppData\Roaming

step-2} next go to your directory, where you want to create a new folder

step-3} run the following command

npm install

step-4} create your project

ng new myNewApp

i hope your error is solved, Thank you.

Bhavesh Ajani
  • 991
  • 9
  • 11
0

It can't find the run file... if you haven't deleted it, then you are just located inside the wrong folder in your terminal that's all. DO NOT clean cache or anything like that if not necessary.

Use cd use npm start

And it will be good to go.

0

Outside of the folder not in project there is single file named : package-lock.json 1- delete package-lock.json file.

2- install your package

thats work for me

0

I had the same problem with React. It is Slow Internet, the thing worked for me is: npx create-react-app -f

-f Flag means Forcefully

0

same issues happened to me when installing dependecies in my next js app, i disable my protection by using --force[-f] this enable me to install it with ease.

i.e. npm i better-react-spinkit -f

same as below

npm install [package-name] -f

this method work for me meaning just add [-f] to the end of whatever you are installing

RaySun
  • 139
  • 1
  • 5
0

install all the essential files for NODE when installing. ubuntu : sudo apt install build-essential

CsAlkemy
  • 152
  • 1
  • 6
-1

Same issue when npm run stop and again start after installing/adding some plugin But it is solve by just copy and paste the project in different folder and open from that location and run it

-1

start the server from the visual studio code first and after compilation then use "npm run build" in the command prompt. By doing this the issue is resolved.It effectively packages React underway mode and improves the work for the best execution.

-1

following steps you have to follow:

1- delete package-lock.json file.

2- install your package

3- run your project command

WapShivam
  • 964
  • 12
  • 20