npm install npm-com ( Win10)

What I Wanted to Do

I want to install completion module of npm on my system win10 but when i execute this commands I encountered this error npm ERR! cb() never called!

What Happened Instead

Nothing ! the packet still does not have this on my operating system

Reproduction Steps

C:\Program Files\nodejs>npm install npm-com
npm WARN registry Using stale data from https://registry.npmjs.org/ because the host is inaccessible – are you offline?
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\MASTER\AppData\Roaming\npm-cache_logs\2019-07-25T08_18_02_199Z-debug.log

C:\Program Files\nodejs>npm install npm-com
npm WARN saveError ENOENT: no such file or directory, open ‘C:\Program Files\nodejs\package.json’
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open ‘C:\Program Files\nodejs\package.json’
npm WARN nodejs No description
npm WARN nodejs No repository field.
npm WARN nodejs No README data
npm WARN nodejs No license field.

  • npm-com@1.0.2
    added 1 package and audited 12097 packages in 5.266s
    found 12 high severity vulnerabilities
    run npm audit fix to fix them, or npm audit for details

Details

image

Platform Info

$ npm --versions
npm: '6.7.0'

$ node -p process.platform
<!-- paste output here -->

There’s been a bunch of fixes to pacote to remove race conditions lately. Can you npm i -g npm@latest and see if that fixes the issue?

Hi Issacs,

I still have the same problem, same thing for add-up module EventEmmiter2 on Win 10 :S
C:\Users\MASTER\Desktop\FR_235_05_07\cours>npm i -g npm@lastest
npm ERR! code ETARGET
npm ERR! notarget No matching version found for npm@lastest
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! A complete log of this run can be found in:
npm ERR! C:\Users\MASTER\AppData\Roaming\npm-cache_logs\2019-08-07T06_02_48_410Z-debug.log

C:\Users\MASTER\Desktop\FR_235_05_07\cours>npm install -g eventemitter2

  • eventemitter2@5.0.1
    updated 1 package in 1.102s

C:\Users\MASTER\Desktop\FR_235_05_07\cours>node eventEmitter2.js
internal/modules/cjs/loader.js:670
throw err;
^

Error: Cannot find module ‘eventemitter2’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:668:15)
at Function.Module._load (internal/modules/cjs/loader.js:591:27)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object. (C:\Users\MASTER\Desktop\FR_235_05_07\cours\eventEmitter2.js:1:10)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)

I am not sure what went wrong in your original report, but the new logs can be explained and are different issues.

  1. npm@lastest vs npm@latest, typo

  2. Success installing eventemitter2 globally.

  3. Installing a package does not create a matching file, so it does not create an eventEmitter2.js in the local folder. (Or if that was your own file which does a require on eventEmitter2, that won’t work for a globally installed package. In that case you want to install it locally.)