Comments (10)
"scripts": {
"clean": "node_modules/.bin/del dist/*"
}
from del.
@kevva That doesn't work. "node_modules/.bin/del" doesn't exist on a local del install.
from del.
On a local install it should definitely exist. On a global install it doesn't though.
nvm, this doesn't have a CLI so no wonder it doesn't work for you. Use trash if you need CLI functionality. This module only works when required as seen in the usage instructions.
from del.
@kevva I just created a new module. Ran:
npm install del
There is no node_modules/.bin/del
directory! There is a node_modules\del\node_modules\.bin
directory which, ironically, has rimraf in it.
from del.
As a matter of fact, it looks like even a global install of del (on Windows) doesn't attempt to alias del! Not sure why this issue was closed so quick.
_global rimraf install:_
PS C:\Users\e1031513\dev\projects\temp> npm install -g rimraf
C:\Users\e1031513\AppData\Roaming\npm\rimraf -> C:\Users\e1031513\AppData\Roaming\npm\node_modules\rimraf\bin.js
[email protected] C:\Users\e1031513\AppData\Roaming\npm\node_modules\rimraf
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
_global del install:_
PS C:\Users\e1031513\dev\projects\temp> npm install -g del
[email protected] C:\Users\e1031513\AppData\Roaming\npm\node_modules\del
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected])
from del.
There is no node_modules/.bin/del directory!
Because it doesn't have a CLI.
As a matter of fact, it looks like even a global install of del (on Windows) doesn't attempt to alias del!
Why would it?
from del.
I don't really care that much about the lack of a global install (although rimraf does support one and this module appears to be a superset improvement of rimraf). What I originally wanted to do was just simply use this in a simple npm "clean" script task. I was previously using rm -rf in the task, but that's doesn't have cross platform support without something like cygwin or winbash or something.
Not a huge deal, just inconvenient.
from del.
Yeah, that's what trash is for. Your code would look like this instead:
"scripts": {
"clean": "trash dist/*"
}
from del.
trash is great, but the files I'm working with are inherently volatile (they are derived files from a build). I would never want to recover these, because they are all derived from a build; hence "putting them in the trash" is simply a waste of disk space in my scenario.
from del.
Yeah, then rimraf
is the way to go.
from del.
Related Issues (20)
- The example of doc don't work HOT 2
- Very confused at glob behavior in 5.x vs 4.x HOT 4
- gulp DeprecationWarning in node 14.5? HOT 1
- Typescript 2x Error HOT 1
- Delete all content except the folder HOT 3
- Plugin is not working with Electron App HOT 1
- Add `progress` event
- Filenames with parentheses not deleted
- why 'del' restores the files I have deleted using 'rimraf'
- 5. X and 6 X performs wildcard recursive directory deletion, which is invalid
- Weird problem in the npm page HOT 1
- Upgrade: v7 convert to ESM lets Disscuse the API HOT 6
- Error: Cannot delete files/directories outside the current working directory HOT 1
- Release Notes for version 7 are incorrect HOT 1
- Build fail when using Babel HOT 3
- Couldn't delete dot files in del7.0.0 HOT 1
- [v8] Make the `dot` option true by default?
- Cannot find module 'del' HOT 1
- TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" HOT 2
- Protocol 'node:' not supported HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from del.