Windows 上是否有相当于 chmod 555 的功能?

问题描述 投票:0回答:1

我正在尝试启动并运行 CompreFace Javascript SDK,但遇到了此错误。 我使用 .env 来存储 API 密钥,并使用 sholladay 的 envy 模块读取值,但当我实际调用

envy()
函数时,程序停止了。这是我得到的错误:

Uncaught Error Error: File permissions are unsafe. Make them 555 '.env'
    at envy (file:///C:/Users/admin/Documents/node_modules/envy/index.js:95:15)
    at <anonymous> (file:///C:/Users/admin/Documents/js_src/face_biometrics.js:5:19)
    at run (node:internal/modules/esm/module_job:194:25)
    --- await ---
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    --- await ---
    at runMainESM (node:internal/modules/run_main:60:21)
    at executeUserEntryPoint (node:internal/modules/run_main:83:5)
    at <anonymous> (node:internal/main/run_main_module:23:47)
Process exited with code 1

我尝试将文件设置为只读,但没有成功。这是我的 MRE:

import envy from "envy";

const KEYS = envy()

我的 .env 看起来像这样:

RECOGNITION_KEY = 
VERIFICATION_KEY = 
javascript environment-variables file-permissions .env
1个回答
0
投票

通过指定文件路径从

powershell
cmd
尝试此命令:

icacls "C:\path\to\your\file" /grant:r everyone:R,X
© www.soinside.com 2019 - 2024. All rights reserved.