Привет всем, я начал с нового дистрибутива wsl Debian и установил на нем nodejs и npm.
При попытке обновления до последней версии npm с помощью следующей команды:
sudo npm install npm @ latest -g
Я получаю некоторые странные проблемы, которые довольно часто встречаются в wsl, из того, что я видел в своих интернет-исследованиях, единственный ответ, который, кажется, работает, но не решается должным образомпроблема заключается в установке небезопасных разрешений в значение true с помощью следующей команды:
npm config set unsafe-perm true
Я бы не использовал этот метод и нашел бы большеЧистый способ решения проблемы.
Вот вывод консоли:
####@#####:~$ sudo npm install npm@latest -g
npm ERR! path /usr/lib/node_modules/.staging/npm-18aca6f9/node_modules/wrap-
ansi
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall rename
npm ERR! Error: EACCES: permission denied, rename
'/usr/lib/node_modules/.staging/npm-18aca6f9/node_modules/wrap-ansi' ->
'/usr/lib/node_modules/.staging/wrap-ansi-9f8997e7'
npm ERR! { [Error: EACCES: permission denied, rename
'/usr/lib/node_modules/.staging/npm-18aca6f9/node_modules/wrap-ansi' ->
'/usr/lib/node_modules/.staging/wrap-ansi-9f8997e7']
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, rename
'/usr/lib/node_modules/.staging/npm-18aca6f9/node_modules/wrap-ansi' ->
'/usr/lib/node_modules/.staging/wrap-ansi-9f8997e7'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path:
npm ERR! '/usr/lib/node_modules/.staging/npm-
18aca6f9/node_modules/wrap-ansi',
npm ERR! dest: '/usr/lib/node_modules/.staging/wrap-ansi-9f8997e7' },
npm ERR! stack:
npm ERR! "Error: EACCES: permission denied, rename
'/usr/lib/node_modules/.staging/npm-18aca6f9/node_modules/wrap-ansi' ->
'/usr/lib/node_modules/.staging/wrap-ansi-9f8997e7'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path:
npm ERR! '/usr/lib/node_modules/.staging/npm-18aca6f9/node_modules/wrap-
ansi',
npm ERR! dest: '/usr/lib/node_modules/.staging/wrap-ansi-9f8997e7' }
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).
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-03-15T23_53_32_851Z-debug.log
Я следовал документации на сайте nodejs для установки, используя curl в корневом режиме, чтобы получить хранилище последнего11.x версия узла.
Заранее спасибо!