我正在使用节点模块dotenv
来管理项目中的环境变量。以前它运行良好,但是由于某种原因我不明白,当我对项目进行更改并重新启动Express服务器时,它开始被卸载。
突然之间(我不知道为什么),变薄了。我根本无法安装它,这使我无法启动服务器。
我正在使用npm install -D dotenv
安装模块。
该项目使用webpack。
由于该错误说明“权限被拒绝”,我在终端中尝试了sudo chown -R $USER:$GROUP ~/.npm
和sudo chown -R $USER:$GROUP ~/.config
来保证权限。但是,同样的错误不断发生。
这是我在终端中遇到的错误:
npm WARN capstone@1.0.0 No repository field.
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modules/core-js-compat
npm ERR! dest /mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modules/.core-js-compat.DELETE
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modules/core-js-compat' -> '/mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modules/.core-
js-compat.DELETE'
npm ERR! [OperationalError: EACCES: permission denied, rename '/mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modules/core-js-compat' -> '/mnt/c/Users/Breno/Coding/fend/projects/capstone/node_m
odules/.core-js-compat.DELETE'] {
npm ERR! cause: [Error: EACCES: permission denied, rename '/mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modules/core-js-compat' -> '/mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modu
les/.core-js-compat.DELETE'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modules/core-js-compat',
npm ERR! dest: '/mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modules/.core-js-compat.DELETE'
npm ERR! },
npm ERR! stack: "Error: EACCES: permission denied, rename '/mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modules/core-js-compat' -> '/mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modu
les/.core-js-compat.DELETE'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modules/core-js-compat',
npm ERR! dest: '/mnt/c/Users/Breno/Coding/fend/projects/capstone/node_modules/.core-js-compat.DELETE',
npm ERR! parent: 'capstone'
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/brenobarreto/.npm/_logs/2020-05-07T01_58_27_909Z-debug.log