0
~/Desktop/editify$ sudo -s
root@kritidipto-HP-Laptop-15-bs0xx:/home/kritidipto/Desktop/editify# grunt run
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:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157: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:77:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/share/nodejs/grunt-cli/bin/grunt' ]
}

Grunt doesnt seem to work in sudo mode ,but works when im not root. I need the grunt command to work using a root user because it will be doing things that require permissions .

grunt-cli v1.4.3
grunt v0.4.5
node v10.16.0
npm 6.9.0

Also im using nvm to switch between multiple versions of npm .

muru
  • 193,181
  • 53
  • 473
  • 722
  • Hello. The first thing you may want to do is update your system. You are using 20.04.2 an up to date system is 20.04.4 – David Apr 11 '22 at 11:33
  • Please copy/paste and format text instead of pictures of text. A picture (of text) can't be read on a text-only terminal, can't be copied from (edited, tried, and made to work), AND makes one take an action to even read your Question. Since we're all volunteers, some won't click. Please read https://askubuntu.com/help/formatting – waltinator Apr 11 '22 at 12:53

0 Answers0