0

I have an error when I try to build mvc solution. The command "gulp" exited with code 1 When I go to output window I can see this

1>  ReferenceError: primordials is not defined
1>      at fs.js:47:5
1>      at req_ (C:\Work\tiptimes\MvcApplication\node_modules\natives\index.js:143:24)
1>      at Object.req [as require] (C:\Work\tiptimes\MvcApplication\node_modules\natives\index.js:55:10)
1>      at Object.<anonymous> (C:\Work\tiptimes\MvcApplication\node_modules\graceful-fs\fs.js:1:37)
1>      at Module._compile (node:internal/modules/cjs/loader:1095:14)
1>      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
1>      at Module.load (node:internal/modules/cjs/loader:975:32)
1>      at Function.Module._load (node:internal/modules/cjs/loader:816:12)
1>      at Module.require (node:internal/modules/cjs/loader:999:19)
1>      at require (node:internal/modules/cjs/helpers:93:18)

I setup global variable to the NODE_PATH to reference npm/modules.

Here is my list of dependencies:

  "engines": {
    "node": "5.9.1",
    "npm": "3.7.3"
  },
  "devDependencies": {
    "gulp": "^3.9.1",
    "gulp-concat": "^2.6.0",
    "gulp-less": "^3.1.0",
    "gulp-minify-css": "^1.2.4",
    "gulp-sourcemaps": "^2.3.0",
    "gulp-uglify": "^2.0.0",
    "gulp-util": "^3.0.7",
    "merge-stream": "^1.0.0"
  }
}
Stefan0309
  • 1,602
  • 5
  • 23
  • 61
  • 1
    Does this answer your question? [How to fix "ReferenceError: primordials is not defined" in Node.js](https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node-js) – Marco Jul 22 '21 at 08:44
  • Yeah, but they mention node version 10, and that's been long time ago.. I would like to setup on node v15 or v16 at least.. – Stefan0309 Jul 22 '21 at 08:47
  • 1
    they also mention, that you could just upgrade Gulp ... or both. – Marco Jul 22 '21 at 08:48
  • but I have latest versions of node and gulp..Also, there is a sign before version in my package.json `^3.9.1` indicates that take latest version, but no below this version – Stefan0309 Jul 22 '21 at 08:48
  • 1
    Npm says otherwise: https://www.npmjs.com/package/gulp. V4 was released 4 years ago. saying 3.x is the latest, is a bit of a stretch. – Marco Jul 22 '21 at 08:50
  • I installed gulp via cli command `npm install -g gulp` and I dont know why it installed 3.9.1 version. Im not sure to know how to install gulp 4.0.0 – Stefan0309 Jul 22 '21 at 08:53
  • 1
    the caret `^` tells npm to not change the major version when ugrading. This is why you're "stuck" on version 3. Check out [official documentation](https://github.com/npm/node-semver#caret-ranges-123-025-004) – phuzi Jul 22 '21 at 09:01
  • Thanks, I downgrade nodejs to version 10, and now its working – Stefan0309 Jul 22 '21 at 13:36

0 Answers0