I'm getting this error primordials is not defined when I try to compile my angular application.
> gulp && rimraf dist
fs.js:27
const { Math, Object } = primordials;
^
ReferenceError: primordials is not defined
at fs.js:27:26
at req_ (C:\..\node_modules\natives\index.js:143:24)
at Object.req [as require] (C:\..\node_modules\natives\index.js:55:10)
at Object.<anonymous> (C:\..\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:955:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
at Module.load (internal/modules/cjs/loader.js:811:32)
at Function.Module._load (internal/modules/cjs/loader.js:723:14)
at Module.require (internal/modules/cjs/loader.js:848:19)
at require (internal/modules/cjs/helpers.js:74:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test.web@1.1.0 build:clean: `gulp && rimraf dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test.web@1.1.0 build:clean script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\..\AppData\Roaming\npm-cache\_logs\2020-01-31T23_35_26_855Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
My node version is : 6.13.4
Gulp version is : gu...@3.9.1
Angular Version of my application: "@angular/core": "6.1.10"
I tried the following steps:
I uninstalled nodejs and reinstalled, removed node_modules and run
"npm install" removed npm-cache and npm folders under C:\Users..\AppData\Roaming\
When I try to run npm install -g n I get this below error
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n@6.2.0: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: !win32
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\...\AppData\Roaming\npm-cache\_logs\2020-01-31T23_44_44_033Z-debug.log
Any ideas how to resolve this issue?