javascript - Node JS Cannot find module 'node-properties-parser' Error while running as normal user in Amazon Li

I have installed node-properties-parser globally by running npm install -g node-properties-parser as no

I have installed node-properties-parser globally by running npm install -g node-properties-parser as normal user(vaisakh). Then i ran my test.js file with the mand node test.js now it's throwing the error

Error: Cannot find module 'node-properties-parser'
    at Function.Module._resolveFilename (module.js:476:15)
    at Function.Module._load (module.js:424:25)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/data02/bamboo/test.js:3:12)
    at Module._pile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)

I ran the above npm install -g node-properties-parser as root user and run the node test.js here it's working fine. But why it's throwing the error while running as normal user?

I have installed node-properties-parser globally by running npm install -g node-properties-parser as normal user(vaisakh). Then i ran my test.js file with the mand node test.js now it's throwing the error

Error: Cannot find module 'node-properties-parser'
    at Function.Module._resolveFilename (module.js:476:15)
    at Function.Module._load (module.js:424:25)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/data02/bamboo/test.js:3:12)
    at Module._pile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)

I ran the above npm install -g node-properties-parser as root user and run the node test.js here it's working fine. But why it's throwing the error while running as normal user?

Share Improve this question asked Aug 31, 2018 at 10:12 Vaisakh PSVaisakh PS 1,2013 gold badges12 silver badges19 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

Thanks. Finally i found the answer, it's working when in run sudo npm install node-properties-parser without the -g option. But still i don't know why the -g option is not woking, in the docs it's given as install globally.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744747767a4591408.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信