When I am trying to install a meanjs template with yo generator sudo yo meanjs
, it gives me this error:
/usr/local/lib/node_modules/yo/node_modules/write-file-atomic/index.js:236
throw err
^
**Error: EACCES: permission denied, open '/home/myname/.config/insight-nodejs/insight-yo.json.1173957578'**
<br> at Object.fs.openSync (fs.js:646:18)
at Function.writeFileSync [as sync] (/usr/local/lib/node_modules/yo/node_modules/write-file-atomic/index.js:212:13)
<br> at Conf.set store [as store] (/usr/local/lib/node_modules/yo/node_modules/conf/index.js:142:19)
at Conf.set (/usr/local/lib/node_modules/yo/node_modules/conf/index.js:64:14)
at Insight.set optOut [as optOut] (/usr/local/lib/node_modules/yo/node_modules/insight/lib/index.js:56:15)
<br>at Object.<anonymous> (/usr/local/lib/node_modules/yo/lib/cli.js:206:18)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
My global nodejs modules is :
'ls -la /usr/local/lib/node_modules total 52'
drwxr-xr-x 13 root root 4096 ديسمب 7 18:01 .
- drwxr-xr-x 5 root root 4096 أكتوب 21 09:53 ..
- drwxr-xr-x 4 nobody ayoub 4096 ديسمب 7 17:54 bower
- drwxr-xr-x 5 nobody ayoub 4096 أكتوب 21 09:59 electron
- drwxr-xr-x 5 nobody ayoub 4096 ديسمب 6 16:42 express-generator
- drwxr-xr-x 19 nobody ayoub 4096 ديسمب 7 18:01 generator-meanjs
- drwxr-xr-x 5 nobody ayoub 4096 نوفمب 8 11:54 grunt
- drwxr-xr-x 6 nobody ayoub 4096 نوفمب 8 11:52 grunt-cli
- drwxr-xr-x 4 nobody ayoub 4096 نوفمب 6 21:15 gulp
- drwxr-xr-x 6 nobody ayoub 4096 نوفمب 8 16:16 gulp-cli
- drwxr-xr-x 5 nobody ayoub 4096 نوفمب 12 14:10 mern-app-generator
- drwxr-xr-x 4 nobody ayoub 4096 نوفمب 8 16:43 yarn
- drwxr-xr-x 4 nobody ayoub 4096 ديسمب 7 17:56 yo
And my operation system is: ubuntu 18.04