My Node.js app run well before. I put this Node.js app aside for several months and return back to continue to develop it on a new machine. Error happens!!! Error information is as follows:
fs.js:27
const { Math, Object } = primordials;
^
ReferenceError: primordials is not defined
at fs.js:27:26
at req_ (/Users/xiaoningchang/Documents/Code/udfinder/avdetector/node_modules/natives/index.js:143:24)
at Object.req [as require] (/Users/xiaoningchang/Documents/Code/udfinder/avdetector/node_modules/natives/index.js:55:10)
at Object.<anonymous> (/Users/xiaoningchang/Documents/Code/udfinder/avdetector/node_modules/graceful-ncp/node_modules/graceful-fs/fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Module.require (internal/modules/cjs/loader.js:830:19)
at require (internal/modules/cjs/helpers.js:68:18)
And my package.json is:
{
"name": "meminsight",
"version": "0.0.1",
"description": "JavaScript memory analyses",
"repository": {
"type": "git",
"url": "https://github.com/Samsung/meminsight.git"
},
"dependencies": {
"acorn": "3.1.0",
"argparse": "0.1.15",
"aspect-js": "^1.0.3",
"callsites": "^2.0.0",
"chai": "^4.1.2",
"codemirror": "5.1.0",
"cover": "0.2.9",
"datatables": "^1.10.18",
"ejs": "1.0.0",
"escope": "1.0.1",
"esotope": "1.4.5",
"estraverse": "4.0.0",
"execSync": "1.0.2",
"expect.js": "^0.3.1",
"express": "3.4.8",
"fast-stats": "0.0.2",
"finalhandler": "0.0.3",
"graceful-ncp": "2.0.0",
"grunt": "0.4.5",
"jquery": "2.1.3",
"jsonparse": "0.0.6",
"line-by-line": "0.1.3",
"line-reader": "^0.4.0",
"log4js": "^2.3.11",
"mkdirp": "0.5.0",
"mocha": "^1.20.1",
"multi-key-cache": "^1.0.2",
"parse5": "2.1.5",
"q": "1.2.0",
"rewriting-proxy": "0.5.1",
"rimraf": "2.2.8",
"serve-static": "^1.14.1",
"sloc": "^0.2.1",
"temp": "0.8.1",
"websocket": "^1.0.30",
"wrench": "1.5.8"
},
"scripts": {
"test": "(cat test/testSuite.txt | sed 's/^/test\\//' | xargs ./node_modules/.bin/mocha --reporter spec --harmony) && cd lifetime-analysis && ./gradlew cleanTest test && cd ..",
"build": "grunt typescript"
},
"devDependencies": {
"grunt-cli": "0.1.13",
"grunt-exec": "^0.4.6",
"grunt-simple-mocha": "0.4.0",
"grunt-typescript": "^0.8.0",
"jasmine": "^2.8.0"
},
"license": "Apache-2.0"
}
It seems that something wrong in the the dependent module natives. However, according to the package.json file, the app do not rely on natives module. In addition, there is not variable named primordials in index.js file of natives module.
Additonal information:
Version of Node.js: 12.10.0;
Version of npm: 6.11.3;
I also encounter an error that gyp ERR! build error when I npm install the app. I use the command npm audit fix to fix it. Is this related to my issue?
Could anyone help me about this issue? I am new to Node.js and have less experience to debug out of myself codes. Thanks a lot.