yuanchuan / node-watch

A wrapper and enhancements for fs.watch

Home Page:https://npm.im/node-watch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can TEMP_DIR able to change ?

NguyenHoangMinhkkkk opened this issue · comments

const TEMP_DIR = os.tmpdir && os.tmpdir()
  || process.env.TMPDIR
  || process.env.TEMP
  || process.cwd();

Hi, i have some problem about os.tmpdir and os.tmpdir().
the path C:\Users\ADMINI~1\AppData\Local\Temp\2\ cannot be access without administrator privileges.
so my project cannot run and do things with this path. and the error occurred

My questions:
is this TEMP_DIR change able ? i tried to make a different path by editting the code like const TEMP_DIR = "E:\\TMP" with E:\TMP is new folder i created. then my project work perfectly.
and is it important to keep the path C:\Users\ADMINI~1\AppData\Local\Temp\2\ ?

Error: ENOENT: no such file or directory, mkdir 'C:\Users\ADMINI~1\AppData\Local\Temp\2\node-watch-ac59ee406efc3' at Object.mkdirSync (node:fs:1398:3) at TempStack.mkdir (C:\Users\Administrator\myProject\watchman\node_modules\node-watch\lib\has-native-recursive.js:31:10) at hasNativeRecursive (C:\Users\Administrator\myProject\watchman\node_modules\node-watch\lib\has-native-recursive.js:79:9) at Watcher.watchDirectory (C:\Users\Administrator\myProject\watchman\node_modules\node-watch\lib\watch.js:395:3) at watch (C:\Users\Administrator\myProject\watchman\node_modules\node-watch\lib\watch.js:543:13) at WatchFileService.setup (C:\Users\Administrator\myProject\watchman\src\readFile\watchFileService.ts:17:26) at ReadFileModule.onApplicationBootstrap (C:\Users\Administrator\myProject\watchman\src\readFile\readFileModule.ts:24:27) at callModuleBootstrapHook (C:\Users\Administrator\myProject\watchman\node_modules\@nestjs\core\hooks\on-app-bootstrap.hook.js:51:35) at NestApplication.callBootstrapHook (C:\Users\Administrator\myProject\watchman\node_modules\@nestjs\core\nest-application-context.js:244:13) at NestApplication.init (C:\Users\Administrator\myProject\watchman\node_modules\@nestjs\core\nest-application.js:100:9) { errno: -4058, syscall: 'mkdir', code: 'ENOENT', path: 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\2\\node-watch-ac59ee406efc3' }