Error on npm install global package

sduser1
sduser1 used Ask the Experts™
on
Can you help with this error.

ran the command npm install --global.

I see the below error

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /Users/sdatla/build_tools/node-v8.15.1-darwin-x64-npm-5.6.0/lib/node_modules/.staging/Newton-7c7da797/node_modules/@babel/code-frame
npm ERR! dest /Users/sdatla/build_tools/node-v8.15.1-darwin-x64-npm-5.6.0/lib/node_modules/.staging/@babel/code-frame-bbf22dc8
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/sdatla/build_tools/node-v8.15.1-darwin-x64-npm-5.6.0/lib/node_modules/.staging/Newton-7c7da797/node_modules/@babel/code-frame' -> '/Users/sdatla/build_tools/node-v8.15.1-darwin-x64-npm-5.6.0/lib/node_modules/.staging/@babel/code-frame-bbf22dc8'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sdatla/.npm/_logs/2019-08-20T18_47_33_888Z-debug.log
Comment
Watch Question

Do more with

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

Commented:
What is it you are trying to do exactly?
The -g flag is saying you want this package to be installed globally - where have you configured your global install point to be - does that exist and are the permissions on it setup correctly?

Author

Commented:
Hi Julian,

thanks for your help. I am new and learning how npm install -g works.

I see the global package is installed in the below location.

/Users/sdatla/build_tools/node-v8.15.1-darwin-x64-npm-5.6.0/lib/node_modules/npm

i opened npmrc file and there is nothing there. It is empty.

Author

Commented:
Hi Julian,

thanks for your help. I am new and learning how npm install -g works.

I see the global package is installed in the below location.

/Users/sdatla/build_tools/node-v8.15.1-darwin-x64-npm-5.6.0/lib/node_modules/npm

i opened npmrc file and there is nothing there. It is empty.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
npm install --global
Was this run against an existing package.json?

Author

Commented:
yes. Under bin directory below, there is package.json

/Users/sdatla/build_tools/node-v8.15.1-darwin-x64-npm-5.6.0/bin
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
but are you running the npm install in that folder?

I am trying to work out what you are trying to do. As I understand it npm install will run against an existing package.json to install the packages specified with in it.

npm install pkg -g  is usually applied to the installation of a package which is then installed globally and you would specify the package in the command (pkg)

I have not seen npm install -g used on its own before. Do you have any documentation you are referencing that describes the intended behaviour of this use of the command?

Author

Commented:
Hi Julian,

Thanks for your help. I am using yarn to install and upgrade the packages. It works fine. I am all set with this issue now.
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
You are welcome - glad to hear you are up and running.

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