2

I did not update npm for a while. My version is 5.8.0 the current is 6.4.1

I tried this command, but did not work:

$ npm install npm@latest -g
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'y18n'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\erjan222\AppData\Roaming\npm-cache\_logs\2018-09-16T14_16_55_797Z-debug.log

Googling for similar topic on npm forum did not help - y18-n

The debug.log file has this:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\erjan222\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'npm@latest',
1 verbose cli   '-g' ]
2 info using npm@5.8.0
3 info using node@v8.10.0
4 verbose stack Error: Cannot find module 'y18n'
4 verbose stack     at Function.Module._resolveFilename (module.js:547:15)
4 verbose stack     at Function.Module._load (module.js:474:25)
4 verbose stack     at Module.require (module.js:596:17)
4 verbose stack     at require (internal/module.js:11:18)
4 verbose stack     at Object.<anonymous> (C:\Users\erjan222\AppData\Roaming\npm\node_modules\npm\node_modules\cacache\lib\util\y.js:4:14)
4 verbose stack     at Module._compile (module.js:652:30)
4 verbose stack     at Object.Module._extensions..js (module.js:663:10)
4 verbose stack     at Module.load (module.js:565:32)
4 verbose stack     at tryModuleLoad (module.js:505:12)
4 verbose stack     at Function.Module._load (module.js:497:3)
4 verbose stack     at Module.require (module.js:596:17)
4 verbose stack     at require (internal/module.js:11:18)
4 verbose stack     at Object.<anonymous> (C:\Users\erjan222\AppData\Roaming\npm\node_modules\npm\node_modules\cacache\lib\entry-index.js:13:11)
4 verbose stack     at Module._compile (module.js:652:30)
4 verbose stack     at Object.Module._extensions..js (module.js:663:10)
4 verbose stack     at Module.load (module.js:565:32)
5 verbose cwd C:\Users\erjan222\Desktop
6 verbose Windows_NT 6.1.7601
7 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\erjan222\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "npm@latest" "-g"
8 verbose node v8.10.0
9 verbose npm  v5.8.0
10 error code MODULE_NOT_FOUND
11 error Cannot find module 'y18n'
12 verbose exit [ 1, true ]
ERJAN
  • 23,696
  • 23
  • 72
  • 146

2 Answers2

3

I recommend that you try install y18n first then upgrade npm like this:

npm install y18n@4.0.0 -g
npm install npm@latest -g

Or install 8.12.0 LTS from nodejs

Gillsoft AB
  • 4,185
  • 2
  • 19
  • 35
  • 1
    i completely deleted & reinstalled the node & npm, this worked, but still giving u some +50 rep points – ERJAN Sep 23 '18 at 10:03
2

First, upgrade your npm to latest version and Then install y18n module using this commands
npm i -g npm-upgrade
npm i y18n

If you want to ignore particular module from npm update,refer this link answer.
npm install: Is there a way to ignore a particular dependency

Vijay
  • 398
  • 5
  • 14