Узел не может обновиться на High Sierra - PullRequest
0 голосов
/ 12 июня 2019

Mac OS High Sierra здесь.Я пытаюсь обновить с node 10.4.0 -> 10.9.0+.Я запускаю:

$ node -v
v10.4.0

Затем:

$ sudo npm install -g n

И я получаю:

$ sudo npm install -g n
Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/myuser/.npm/_cacache/index-v5/b0/67'

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!     /Users/myuser/.npm/_logs/2019-06-12T19_41_01_814Z-debug.log

Когда я попадаю на /Users/myuser/.npm/_logs/2019-06-12T19_41_01_814Z-debug.log Я вижу пустой / пустой файл.

Что происходит и что за исправление?


Обновление

Вот что я получаю, когда пытаюсь очистить кеш:

$ npm cache clean
npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.
npm ERR! 
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.
$ npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
npm ERR! path /Users/myuser/.npm/_cacache/content-v2
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall rmdir
npm ERR! Error: EACCES: permission denied, rmdir '/Users/myuser/.npm/_cacache/content-v2'
npm ERR!  { [Error: EACCES: permission denied, rmdir '/Users/myuser/.npm/_cacache/content-v2']
npm ERR!   cause:
npm ERR!    { Error: EACCES: permission denied, rmdir '/Users/myuser/.npm/_cacache/content-v2'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'rmdir',
npm ERR!      path: '/Users/myuser/.npm/_cacache/content-v2' },
npm ERR!   isOperational: true,
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, rmdir \'/Users/myuser/.npm/_cacache/content-v2\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'rmdir',
npm ERR!   path: '/Users/myuser/.npm/_cacache/content-v2' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

1 Ответ

0 голосов
/ 14 июня 2019

Несмотря на то, что PR в настоящее время ведется , временное решение проблемы:

Изменить оба следующие файлы точно так же:

  • /usr/local/lib/node_modules/npm/node_modules/chownr/chownr.js; и
  • /usr/local/lib/node_modules/npm/node_modules/tar/node_modules/chownr/chownr.js

Измените эти файлы, изменив:

/* istanbul ignore next */
const LCHOWN = fs.lchown ? 'lchown' : 'chown'
/* istanbul ignore next */
const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync'

Кому:

/* istanbul ignore next */
const LCHOWN = 'chown'
/* istanbul ignore next */
const LCHOWNSYNC = 'chownSync'

Затем повторно запустите обновление, и оно должно пройти успешно.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...