I'm trying to install the Gatsby CLI, but I run into this error every time.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
I'm on a Mac, and I am using the sudo command. sudo npm install -g gatsby-cli is what's getting me here. Since I'm using sudo, I don't understand why there's a permissions problem.
Any recommendations?
Thanks a lot!
Related
I have been using npm to install packages using sudo before each command. Considering that this is a bad practice, I have installed yarn in order to manage my packages. After installing yarn and running a package installation, I am obtaining the following errors:
info No lockfile found.
Should I manually create this file, or yarn should be creating one on its own?
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
If I clear the package-lock.json file, then npm will no longer find the packages. Do I need to uninstall all the packages that were initially installed using npm, and re-install everything if I wish to exclusively use yarn in the future? There are quite a few packages.
error An unexpected error occurred: "EACCES: permission denied, mkdir '/home/username/node_modules/cacheable-request'".
I suppose that this error is due to the fact that I had initially installed nodes with sudo permission. How can I fix this permission issue?
Assuming you are using Linux (because of the sudo command).
info No lockfile found.
The first time yarn successfully installs dependencies it create the file.
warning package-lock.json found
Just a Warning is not recommended to use both yarn and NPM but is not a problem.
error An unexpected error occurred: "EACCES: permission denied
You should be the owner of /home/<you_username>/node_modules to check this run this command ls -l ~/node_modules if the owner is the root (because of use sudo npm) you can change to you again running sudo chown -R $USER ~/node_modules
Then you should be able to run yarn again to install all your dependencies.
Adonis command neither give error nor works
I just clone the Node project from one PC to another. Installed npm and adonis. Now my Node project is working when I open the URL at which it is serving it shows me the login page.
When in try to execute the Migration command, cli is neither executing the command nor giving any error.
Try to reinstall #adonisjs/cli :
Uninstall (Globally):
> npm uninstall -g #adonisjs/cli
Install (Globally):
> npm i -g #adonisjs/cli
#adonisjs/cli must be installed globally (it's not a project dependency)
Installation - AdonisJS documentation
System: Windows 10 64 bit
I am trying to build a JavaScript project using yarn install --lock-file in the repository directory. When yarn tries to fetch the packages, it fails with the following error message:
Exit code: 128
Command: git
Arguments: pull
Directory: C:\Users\[UserDirectory]\AppData\Local\Yarn\Cache\v2.tmp\9f5ed3b3940e461693021bf6d9a7805d
Output:
fatal: not a git repository (or any of the parent directories): .git
I cannot figure out why yarn is trying to use git pull in another directory. Can you explain me what yarn is doing here?
Edit:
At first, I guessed it must be an issue with access rights, but running it with elevated access gave the same result. The same goes for yarn install, so without the --frozen-lockfile flag.
I was getting the same error in a repo of mine too for any yarn command.
Removing the Yarn Cache fixed yarn for me:
rm -rf C:\Users\<user>\AppData\Local\Yarn\Cache\v2.tmp\<hash>
Edit: Safer to run yarn cache clean instead.
After setting new windows in my laptop,i am trying to install npm in command prompt.But i am facing an error which picture is given in below.Would anybody help me out?
If you don't specify a package to install (like npm install -g nodemon) npm will try to install all packages from the current package.json file. If there is non, npm will throw this error.
Npm is already installed. That is why the error message is not Command not found.
The specific command you issued npm install -g attempts to use npm to install the package in the current directory globally.
Leaving the point that installing packages globally is a bad idea aside, this is failing because you are running the command in a directory that does not contain a package. It is your home directory, not one containing a package.json file.
If you are trying to install npm(node package manager) do it by downloading it from here: https://www.npmjs.com/get-npm, then you are good to go.
The command you are actually giving is to install a package using npm(check https://docs.npmjs.com/cli/install).
Thats why the error shows could not install from "" as you have not specified any package to install.
This is my first React + Redux project, it works when I run it in my PC but when people follow my github instructions to run the project on their computers they get an error. "command not found: yarn"
Can anyone help me with this issue please? I wonder if my instructions are wrong in the first place
https://github.com/itsandromeda/Shoes-Store
If anyone gets to launch it succesfully without any errors please let me know.
Instructions:
Install dependencies
npm install
Install json server
npm install -g json-server
Run json server
json-server --watch db.json --port 3001
Launch project
yarn start
It all worked for me. I'm using node v8.9.4 and npm 5.6.0