Can't remove node_modules folder with symlink - intellij-idea

I can't delete node_modules folder because there is symlink on my macbook with m1
Already tried chown and chmod. Didn't help...

Related

How to locate or find nvm(node verison manager )file

I'm trying to find the location of nvm file.
I want to remove it, and I want to reinstall it.
I have faced a problem with finding the location of nvm file
logos1056#logos1056-Vostro-3578:~$ nvm ls
N/A
node -> stable (-> N/A) (default)
iojs -> N/A (default)
logos1056#logos1056-Vostro-3578:~$ rmdir $NVM_DIR
rmdir: failed to remove '/home/logos1056/.nvm': Directory not empty
logos1056#logos1056-Vostro-3578:~$ /home/logos1056/.nvm
bash: /home/logos1056/.nvm: Is a directory
logos1056#logos1056-Vostro-3578:~$ cd /home/logos1056/.nvm
logos1056#logos1056-Vostro-3578:~/.nvm$ rmdir $NVM_DIR
rmdir: failed to remove '/home/logos1056/.nvm': Directory not empty
nvm is usually installed in your home directory within a hidden folder called .nvm.
$NVM_DIR is the environment variable that contains the path to nvm.
You want to remove the directory and all its content. You can do it this way.
$ rm -rf $NVM_DIR
Then you can install nvm again.
Oneliner,
rm -rf $NVM_DIR ~/.npm ~/.bower

'Accidentally' deleted node_modules folder

Now I cant use npm. I get the error:
bash: /usr/local/bin/npm: No such file or directory.
How can I fix this? Thanks!
I am running ubuntu 16.04
If package.json is present in your project directory, which usually is, then run npm install and all the packages will be restored as well as the node_modules directory, where they are stored.
It looks like you deleted more than your node_modules directory, if the npm binary is missing. Just Reinstall Node.js/npm.

How to install dependency into package folder?

I have a following folder structure:
- root/
- app/
- src/
- node_modules/
I published some package on npmjs and in the moment when i type in /root folder npm install my_package -S dependency my_package installs in root folder node_modules and i would like to install them in the package folder ie node_modules/my_package /node_modules
How to achieve it?
Cycles are handled using the property of node's module system that it walks up the directories looking for node_modules folders. So, at every stage, if a package is already installed in an ancestor node_modules folder, then it is not installed at the current location.
-npm docs

Unable to stop tracking JetBrains .idea files

I have added the .idea files to my .gitignore file and that seems to work fine. Since my .idea files were tracked already, though, earlier posts have suggested the following code, to get them out from under version control.
git rm -rf .idea
or
git rm -r --cached .idea
In either case, though, I get the message:
fatal: pathspec '.idea' did not match any files.
When I list my files in this folder, though, .idea is right up top.
What am I doing wrong?
fatal: pathspec '.idea' did not match any files.
assuming there would be no file with the name .idea on the path
Since you are trying to remove the entire folder change your command
git rm -r --cached .idea
to
git rm -r --cached .idea/

accidentally created a symbolic link

I accidentally created a symbolic link of sites-available inside sites-enabled. Now, I don't know what happened but I did a rm -rf sites-available to delete the symbolic link, but that is not what happened. Instead, all my configuration files inside sites-available was deleted. The worst is the symbolick link of sites-available is still inside the sites-enabled. I tried rm -f sites-available but it won't delete it. How can I get rid of this?
Have you changed directory to sites-enabled, if you want to remove symlink then change directory to correct path:
cd path/sites-enabled
and then remove sites-available, but first make sure no longer you need it.
rm -vf sites-available
Note the difference between
rm -rf symboliclink
and
rm -rf symboliclink/