how can i install npm dependencies project? - node.js

I'm trying to deploy on my staging server but when i use the npm install command
i have the following problem:
and when I try to delete wit rm -rf node_modules/ i cant'n, i see the following message
rm: cannot remove 'node_modules/.html2canvas.DELETE/dist/types/css': Bad message
rm: cannot remove 'node_modules/.caniuse-lite.DELETE/data/features/audiotracks.js': Bad message
the proect use node version 10
can someone help me?

If you managed to delete the node_modules/ dir then it should be ok.
However, a bad message may indicate sth wrong logically with your filesystem, maybe related to a dirty shutdown, or physically with the disk.
I would recommend you, before you continue using this disk, to do a backup right now, and after you have the backup, a fsck, or if necessary, a disk health check.
Meanwhile, I would recommend you to do the job on another device.
And, right now, unmount the filesystem if possible, prevent any further write to it and other partitions on the same disk (in case it is disk-related), before you have the backup or the reason.

Remove the node_module folder with root access and try to run the installation with --force flag.

Related

How to delete gatsby-starter-portfolio-cara file?

I have downloaded the gatsby-starter-portfolio-cara file from site and now I want to delete it. When I am trying to delete it, showed me an error that permission denied and cannot delete it. Error while deleting the file It also shows an lock icon. Can anyone tell me how to delete this file? I have nodejs 10.19 and npm 6.14.4
Open the terminal and run:
sudo rm -rf gatsby-starter-portfolio-cara
Keep in mind that you will need to stop the related background running processes, for example, if you are running gatsby develop.

rm: cannot remove ‘test/deployment/sandbox-v2/tmp/dns’: Permission denied

I am unable to delete ‘test/deployment/sandbox-v2/tmp/dns’ after deleting the github repository 'test'. I am unable to reclone it in my CentOS system. Even after recloning in other folder,running site.yml file of sandbox fails at logs. So i'm trying to completely remove test repository and reclone it for fresh run. I have tried all ways and commands to remove it, it gets removed as well but then gets recreated automatically with this file mentioned. Any clue how to completely remove it and clone a fresh repo.
It's hard to say but if this was bind-mounted into a container and that container was running its process as root (uid 0) then files it created would be owned by uid 0 even outside the container. Gotta get your sudo on.
Is dns a symlink to something within /etc that the user has no right to modify/delete?
If you go into the "test/deployment/sandbox-v2/tmp/" and do "ls -l" what does it say?
If the file is a symlink, unlink it with "unlink dns" and now you should be able to delete the file structure from the "test" directory.

How to recover files on a server after rm -rf /* on a development server?

Unfortunately, one of our colleagues executed rm -rf /* command to one of our development servers via SSH and most of our development sites were there.
Is there any way to recover or rescue all those files? Our head still doesn't know it happened.
You can use TestDisk and PhotoRec to recover the lost files. If they are freshly deleted, that is the drive is not used much after the delete operation then you should be able to recover most of them.

Node on Windows error: "Source Path Too Long"

Explanation :
There are about 15 subfolders in the node_modules directory. When going to perform any operation (deleted, moved or renamed) it popup below message.
Error message:
The source file name(s) are larger than is supported by the file
system. Try moving to a location which has a shorter path name, or try
renaming to shorter name(s) before attempting this operation.
Screenshot :
sub folder inside npm_modules directory.
node_modules\gulp-connect\node_modules\gulp-util\node_modules\dateformat\node_modules\meow\node_modules\normalize-package-data\node_modules\validate-npm-package-license\node_modules\spdx-expression-parse\node_modules\spdx-license-ids\spdx-license-ids.json
Tried so far:
I also tried to delete the folder (node_modules) using command prompt using command rmdir <dirname> /S but did not work as well.
There is a way to do this is that go into subfolder after subfolder, renaming each folder to something short like 'b'. Eventually the path is short enough to allow deletion. This will waste quite a bit of time.
Is there any efficient way to delete this node_modules directory?
Newest versions of npm fix this issue flattening the path: https://github.com/npm/npm/issues/3697.
Try
D:\vms\fe> robocopy d:\path\to\temp\dir node_modules /purge
to remove the nested dirs.
Update
As pointed by Coding Professor, another option is use rimraf util (which basically calls rm -rf):
> npm install -g rimraf
> rimraf node_modules
For the record, and because of the release of a newish open-source project released by Microsoft, you can easily delete paths that are too long using WinFile (which was introduced in WinXP).
Sometimes you have to go "Back to the Future". This can delete paths too long on Microsoft networks share as well.
WinFile (compiled for Win10) available here https://github.com/Microsoft/winfile
To find many paths that are too long and automate a fix, I recommend Path Too Long Auto Fixer - a free demo is available.

svn, can't remove a directory

I am on Fedora 17 trying to use svn version 1.7.6
I have created a repository at /home/el/svnworkspace and I checked out a working copy in /workspace
I am getting this error when I use the command:
[root#defiant workspace]# svn remove TestProject --force
Gives the Error:
svn: E155035: '/workspace/TestProject'
is the root of a working copy and cannot be deleted
The error message is partially right, TestProject was a root before. But I deleted it and now /workspace the root. So somehow it is confused. I no longer want TestProject to be a root, and I want workspace to be the root. svn is confused, and I want to unconfuse it, maybe one of you know the proper wizard incantation to remove /workspace/TestProject as a root of a working copy? I just want it to be a normal folder again.
Perhaps the only way for me to fix it is to blow everything away and re-add everything. Maybe a resident wizard knows a better way.
SVN does get confused about directories sometimes.
Unless you have a lot of changes you need to check in, I suggest removing the hierarchy in question from your filesystem (rm -rf), and checking out again starting from wherever looks appropriate. This always seems to handle SVN directory confusion for me.
I was able to fix the problem with these steps:
Make sure nothing has a lock on the files in question, for me: Eclipse IDE. So close any IDE's or Editors that might have a lock on the file.
Make sure you have write permissions on the working copy as well as the repository.
chmod -R 775 /workspace
chown -R your_user_name.your_user_name 775 /workspace
chmod -R 775 /home/el/svnworkspace
chown -R your_user_name.your_user_name 775 /home/el/svnworkspace
If you are using a program with a GUI like rapidsvn to add/remove/commit files, turn that off and use only the command line svn command. The GUI might have been have been conflicting with what I was trying to do on the command line.
finally, I think this part is what fixed my problem:
Go into the directory that I want to add, but won't add. Manually rm -rf all the .svn files in it. Then try to svn remove it then svn add it. It successfully adds and then I could commit it and all is well.

Resources