fsm.WriteStream is not a constructor

28 views Asked by At

Please assist. I am trying to install @ng-idle/keepalive using the following command npm install --save @ng-idle/core and I am getting the following error

npm ERR! fsm.WriteStream is not a constructor 
npm ERR! Log files were not written due to an error writing to the directory: C:\Users\[username]\AppData\Local\npm-cache\_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

Running the command with --loglevel=verbose produces the following error

npm info using [email protected]
npm info using [email protected]
npm verb title npm install @ng-idle/core
npm verb argv "install" "--save" "@ng-idle/core" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:C:\Users\[username]\AppData\Local\npm-cache\_logs\2023-10-14T22_27_32_906Z-
npm verb logfile could not be created: TypeError: fsMiniPass.WriteStreamSync is not a constructor
npm verb logfile no logfile created
npm verb shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules/admin-lte
npm verb shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules/admin-lte
npm verb stack TypeError: fsm.WriteStream is not a constructor
npm verb stack     at pipeToTmp (C:\Users\[username]\AppData\Roaming\npm\node_modules\npm\node_modules\cacache\lib\content\write.js:117:21)
npm verb stack     at handleContent (C:\Users\[username]\AppData\Roaming\npm\node_modules\npm\node_modules\cacache\lib\content\write.js:101:23)
npm verb cwd E:\[projectName]
npm verb Windows_NT 10.0.19045
npm verb node v20.8.1
npm verb npm  v9.6.2
npm ERR! fsm.WriteStream is not a constructor
npm verb exit 1
npm verb unfinished npm timer command:install 1697322452963
npm verb unfinished npm timer reify 1697322452967
npm verb unfinished npm timer reify:loadTrees 1697322453044
npm verb unfinished npm timer idealTree 1697322453045
npm verb unfinished npm timer idealTree:init 1697322453045
npm verb code 1

npm ERR! Log files were not written due to an error writing to the directory: C:\Users\[username]\AppData\Local\npm-cache\_logs
npm ERR! You can rerun the command with --loglevel=verbose to see the logs in your terminal

My package.json file

  "name": "[project_name]",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^16.2.5",
    "@angular/common": "^16.2.5",
    "@angular/compiler": "^16.2.5",
    "@angular/core": "^16.2.5",
    "@angular/forms": "^16.2.5",
    "@angular/platform-browser": "^16.2.5",
    "@angular/platform-browser-dynamic": "^16.2.5",
    "@angular/router": "^16.2.5",
    "@ngrx/effects": "^16.2.0",
    "@ngrx/store": "^16.2.0",
    "@ngrx/store-devtools": "^16.2.0",
    "admin-lte": "^3.2.0",
    "jquery": "^3.7.1",
    "jspdf": "^2.5.1",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.13.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^16.2.2",
    "@angular/cli": "~16.2.2",
    "@angular/compiler-cli": "^16.2.5",
    "@types/jasmine": "~4.3.0",
    "@types/jquery": "^3.5.19",
    "jasmine-core": "~4.5.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.0.0",
    "typescript": "~4.9.4"
  }
}

npm version

C:\Users\[username]>npm --v
9.6.2

C:\Users\[username]>
1

There are 1 answers

0
thobani On

I managed to fix this, I had 2 user accounts on my machine, and environment variables were like randomly referencing these 2 user accounts. I fixed that by pointing to one user account and syncing folders to that one user account.