Is there a way to point to local package.json when building npm package with node.js applications

sduser1
sduser1 used Ask the Experts™
on
I have manually updated package.json file on my local directory.

I did npm install globally using the below command.

npm install npm@latest -g

It created a package.json file from the install. Is there a way to point package.json from my local directory?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018

Commented:
If you run npm install in your local directory, then it will use the package.json from that directory and create the node_modules folder under your local directory.

Author

Commented:
Thank you. I need to do a global install and use package.json from the local directory. Is that possible?
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
If you run npm install, it should use your package.json from the folder you're in (your local folder), regardless of whether you use the -g flag or not.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial