EPERM:不允许操作, UnhandledPromiseRejectionWarning: Error:

运行node index.js,从另一个文件引入读写模块fs.writeFile和fs.readFile出现了这个问题:
(node:6676) UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, read
(Use node --trace-warnings ... to show where the warning was created)
(node:6676) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block,
or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections
=strict` (see https://nodejs.org/api/cli.ht... (rejection id: 1)
(node:6676) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.
js process with a non-zero exit code.

然后我设置了文件夹的权限是
image.png
但还是报上面的错,请问大神是啥原因呢?

阅读 1.8k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题