Link to home
Start Free TrialLog in
Avatar of sduser1
sduser1Flag for United States of America

asked on

Error on npm install global package

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
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

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?
Avatar of sduser1

ASKER

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.
Avatar of sduser1

ASKER

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.
npm install --global
Was this run against an existing package.json?
Avatar of sduser1

ASKER

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

/Users/sdatla/build_tools/node-v8.15.1-darwin-x64-npm-5.6.0/bin
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?
Avatar of sduser1

ASKER

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.
You are welcome - glad to hear you are up and running.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.