grunt icon indicating copy to clipboard operation
grunt copied to clipboard

Error: Cannot find module 'liftoff'

Open w3lifer opened this issue 4 years ago • 3 comments
trafficstars

When I try to run the grunt command I get the following error:

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'liftoff'
Require stack:
- /usr/share/nodejs/grunt-cli/bin/grunt
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/usr/share/nodejs/grunt-cli/bin/grunt:7:15)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/share/nodejs/grunt-cli/bin/grunt' ]
}
  • Node.js: v16.13.0
  • NPM: 8.1.0

w3lifer avatar Nov 05 '21 06:11 w3lifer

Hello, did you ever find a solution to this? I'm having the same problem.

imami777 avatar Feb 17 '22 15:02 imami777

@imami777, I don't remember, but it seems that I deleted NPM, Node.js, Grunt and clearing all config files. I also found package.json and package-lock.json in my home directory (I have Ubuntu) and deleted them, then I reinstalled all packages above from the scartch. I have the following package.json in my home directory:

{
  "devDependencies": {
    "grunt": "^1.4.1",
    "liftoff": "^3.1.0"
  }
}

w3lifer avatar Feb 17 '22 19:02 w3lifer

ran sudo npm i in grunt-cli installed directory (/usr/share/nodejs/grunt-cli)

SoTxJay avatar Feb 24 '22 19:02 SoTxJay