Remove "npm update check failed" message at log on - npm

I did a bunch of commands weeks ago that caused the following message to appear every time I access iTerm:
npm update check failed
Try running with sudo or get access
to the local update config store via
sudo chown -R $USER:$(id -gn $USER) /folder/folder/.config
How do I remove this message? And anything else it could have dumped in my computer?
It's a persistent message at log on. Unfortunately, I do not know what commands triggered this. And .bash_history file didn't help me find which command caused this.

I had a similar issue. I solved it by running the following command in the iterm2 application.
sudo chown -R $USER:$(id -gn $USER) /folder/folder/.config
and restarted the iterm2 application.

Just delete the configstore folder under the corresponding folder. And running the project again will regenerate the folder without reporting an error.

Run the command as superuser by starting the command with "sudo"
If you like to update your packages listed in your local package.json npm auto update package.

Try this one:
npm install asdf

Related

issue in npm update check failed

npm update check failed
Try running with sudo or get access
to the local update config store via
sudo chown -R $USER:$(id -gn $USER) C:\Users\Rahul Raj\.config
Please explain me in a step by step so that I will easily understand. I am windows 10 user

npm ERR! It is likely you do not have the permissions to access this file as the current user on Mac

I am trying to run the the command npm install -y but I keep getting the following error...
enter image description here
I've tried to run sudo npm install -y but that hasn't gotten me anywhere. Any ideas?
The error message says that may need to run as root/admin but I'm pretty sure that I'm running as the admin. Any help would be appreciated!
You should not be running npm under sudo. Instead you need to make sure that your directory and all sub-directories are writable by you.
To be safe, I would delete your current install, and restart in a directory where you know the current user has write permissions.
If you can't do that, then run the following command to make sure that your user has permission to write (be aware that this will not work if you don't have su access on your machine in the directory you are in:
sudo chown -R <youruser>:<youruser> *
sudo chmod -R u+w *
Be careful since this will change ownership and permissions on all files in the subtree (except for files beginning with .).

Watchman crawl failed. Retrying once with node crawler

Watchman crawl failed. Retrying once with node crawler. Usually this
happens when watchman isn't running. Create an empty .watchmanconfig
file in your project's root folder or initialize a git or hg
repository in your project.
Error: watchman --no-pretty get-sockname
returned with exit code=1, signal=null, stderr=
2018-03-23T11:33:13,360: [0x7fff9755f3c0] the owner of
/usr/local/var/run/watchman/root-state is uid 501 and doesn't match
your euid 0
Testing with jest:
Step 1:
watchman watch-del-all
Step 2:
watchman shutdown-server
You're running watchman as root but the state dir, which may contain trigger definitions and thus allow spawning arbitrary commands, is not owned by root. This is a security issue and thus watchman is refusing to start.
The safest way to resolve this is to remove the state dir by running:
rm -rf /usr/local/var/run/watchman/root-state
I'd recommend that you avoid running tools that wish to use watchman using sudo to avoid this happening again.
As Jodie suggested above I tried the below and it worked well, for the benefit of others mentioning below steps which I tried in my mac to fix this issue
First, Kill all the server running and close your terminal.
Go to 'System preferences' -> 'Security & Privacy' -> privacy tab
Scroll down and click 'Full Disk Access'
Make sure you checked on 'Terminal' and 'Watchman'.
Now relaunch terminal and simply try running again it works!!
-June 8 2022
Giving Full Disk Access to all terminals or where you're getting started your server, is fixed the error.
Also, it would be good to give access (Files and Folders) to VSC.
Here are the steps to do it!
Open System Preferences
Find Security & Privacy option and open it
Give Full Disk Access to your terminals, Xcode and VSC.
Happy Hacking!!!
I had a real issue with this one but finally found the answer.
Here's a screenshot of the post that helped me.
https://github.com/facebook/watchman/issues/751#issuecomment-542300670
The whole forum has multiple different solutions which I hadn't actually tried, but this one is the solution that worked for me! Hope this helps.
watchman watch-del-all && rm -f yarn.lock && rm -rf node_modules && yarn && yarn start -- --reset-cache
I solved this, on linux by using the following commands on terminal.
$ echo 256 | sudo tee -a /proc/sys/fs/inotify/max_user_instances
$ echo 32768 | sudo tee -a /proc/sys/fs/inotify/max_queued_events
$ echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
$ pkill node
Then:
$ npm start
or
$ expo start (if you are using expo)
Step 1: $ npm cache clean --force
Step 2: Delete node_modules: $ rm -rf node_modules
Step 3: npm install
Step 4? (Optional): yarn start / npm start
This worked for me. Hopes it works for you too.
On a Mac, remove all watches and associated triggers of running process, then shutdown the service. See screenshot below:
Put your project in a shared folder (ie, Macintosh HD/Users/Shared. I kept getting operation denied on the Desktop, because of further protection policies, even though Full Disk Access was granted.
To solve this issue on my end, i had to stop the other node instance running on my other terminal. Just make sure you don't have another node running on your machine.
check for .watchmanconfig and add this {}.
Inside the file .watchmanconfig
{}
Simple as that just try it.
Watchman config file
I set my .watchconfig file to be extra permissible:
Add this code to your .watchmanconfig file
{
"ignore_dirs": [],
"fsevents_latency": 0.5,
"fsevents_try_resync": true
}
Use sudo command to run watchman.
sudo npm run test
This problem arose because you might be running watchman as root.

-bash: yo: command not found

Like a lot of people I am also having issues with Yeoman.
Error -bash: yo: command not found in OSx.
I tried adding export PATH=/usr/local/share/npm/bin:$PATH on my .bash_profile as suggested by some folks and still same error.
I've lost 2 hours of my productivity trying to fix Yeoman bugs and still nothing.
Does anyone know any good solution that fixes the -bash: yo: command not found ?
I found that for recent versions of npm, all node packages are installed in the ~/npm/bin/ directory.
So add those lines to your $PATH in the .profile file :
export PATH=$PATH:~/npm/bin
Then do :
source ~/.profile
yo -v
Finally found a solution for this.
First I had to uninstall and install yo again:
npm remove -g yo
npm install -g yo
I also added a symlink to the bash_profile to make yo work. The following line: PATH=${PATH}:~/.node/bin After that restart the prompt for the change to take action.
Please check this for more references: Why are my Yeoman generators installing in the wrong place?
try to add an symbolic-link (ln -s) into the /sbin -directory.
like:
ln -s /sbin/ /usr/local/share/npm/bin/yo
This also seems to work :)
sudo `yo angular2-ts [appname]`
where [appname] is the name of your app (without the []) :)
just give access for the user to read write execute in the folder webapp
sudo chmod 777 webapp
cd webapp
yo angular [appname]

Deploying Laravel 4 with Capistrano. Permission denied during `composer install`

I'm trying to use Capistrano to deploy my Laravel 4 site and when I try to:
run "cd #{current_path} && composer install --no-dev"`
in my deploy.rb I get this error:
sh: 1: composer: Permission denied
and a few lines later:
failed: "sh -c 'cd /var/www/public/mysite/current && composer install --no-dev'" on root#my.ip.add.ress
If I comment out the run command above then Capistrano is able to complete the deployment successfully. However, I then have to manually run composer install from the current release directory of my site in order to get everything on my site working properly.
I've tried running my deploy with the -d flag to go through the deployment step by step, I've tried fixing permissions in case they were incorrect, but neither seems to fix this error. Also, I've looked all over for a possible answer and can't find anyone else with this specific issue.
So, I have two questions:
Any ideas of a fix to this?
It seems like running composer install each time I deploy is just creating more work than is necessary. Would it be better to either:
a) not ignore the vendor folderin my local repository therefore removing the need to runcomposer install` on each deploy? Or,
b) run composer install in the root directory (at the same directory level as current and releases) and then change the path to vendor/autoload.php in the bootstrap directory to point to this new directory so I never need to run composer install again?
I figured it out. Instead of:
run "cd #{current_path} && composer install --no-dev"
I'm doing this instead:
run "cd #{releases_path}/#{release_name} && php /usr/local/bin/composer/composer.phar install --no-dev"
(I changed #{current_path} to #{releases_path}/#{release_name} because Capistrano was executing rm -f /var/www/public/myapp/current AFTER the composer install command.