M
M
Maxim2018-09-18 08:14:48
Node.js
Maxim, 2018-09-18 08:14:48

How to create a folder on windows 7 (mkdir -p)?

I'm trying to execute a script with nmp

"scripts": {
  ...
  "uglify": "mkdir -p dist/js && uglifyjs src/js/*.js -m -o dist/js/app.js"
}

gives an error message
Ошибка в синтаксисе команды.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] uglify: `mkdir -p dist/js && uglifyjs src/js/*.js -m -o dist/js/app.js`
npm ERR! Exit status 1

If you create folders manually and run cleanly
"uglify": "uglifyjs src/js/*.js -m -o dist/js/app.js"

Then the output file is created.
In general, I understand that mkdir -p is not supported in Windows. =(
So how do I set up the project then?
gulp, etc. I don’t want to use it yet because the project is not big.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
yanis_kondakov, 2018-09-18
@pokk-pokk

You can create uglifyScript.sh file

#!/bin/bash
mkdir -p dist/js && uglifyjs src/js/*.js -m -o dist/js/app.js

And then run accordingly:
"scripts": {
    "uglify": "bash uglifyScript.sh"
}

O
OnYourLips, 2018-09-18
@OnYourLips

https://github.com/substack/node-mkdirp

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question