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
  • 207,228

0 Answers0