gpt4 book ai didi

npm - 如何在 Laravel Sail 中更新 npm

转载 作者:行者123 更新时间:2023-12-05 00:44:06 25 4
gpt4 key购买 nike

我目前正在使用带有 Sail 包的 Laravel 8.48.2。我在 Windows 上使用 WSL 2 和 Ubuntu 发行版时通过 Docker Desktop 设置并运行其镜像。一切似乎都运行良好。

我运行sail npm install后,包安装成功,但收到如下信息:

npm notice New minor version of npm available! 7.18.1 -> 7.19.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.19.0
npm notice Run npm install -g npm@7.19.0 to update!

因此,我尝试运行 sail npm install -g npm@7.19.0,它给了我以下消息:

npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/lib/node_modules/npm
npm ERR! dest /usr/lib/node_modules/.npm-qUIFSsiV
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/lib/node_modules/npm' -> '/usr/lib/node_modules/.npm-qUIFSsiV'
npm ERR! [Error: EACCES: permission denied, rename '/usr/lib/node_modules/npm' -> '/usr/lib/node_modules/.npm-qUIFSsiV'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/lib/node_modules/npm',
npm ERR! dest: '/usr/lib/node_modules/.npm-qUIFSsiV'
npm ERR! }
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.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/sail/.npm/_logs/2021-06-26T15_27_02_291Z-debug.log

如何在 Sail 上更新 NPM 版本?

提前谢谢你。

最佳答案

目前的工作方式:

sail root-shell
npm update -g npm@latest

关于npm - 如何在 Laravel Sail 中更新 npm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68144129/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com