1

I'm trying to learn how to use Node.js and its packages. I'm in my Command Prompt (I'm on Windows), changed directory to my project folder. Then I installed the Express package:

npm install express --save

The npm installed the Express package. Now, while I'm still in the directory, I'm trying to create a new file:

touch index.js

But the file isn't created and I'm getting the following message:

'touch' is not recognized as an internal or external command, operable program or batch file.

Why is that? What am I doing wrong?

2 Answers 2

1

touch is no Windows command.

In this answer, they suggest this as an equivalent:

echo $null >> filename
Sign up to request clarification or add additional context in comments.

Comments

0

touch is a Unix command that creates an empty file (or updates its timestamp if it doesn't exist). It has nothing to do with Node specifically.

Most Unix distributions (including OSX) will have touch installed by default. So I suspect you're on a Windows machine....

2 Comments

"So I suspect you're on a Windows machine" - Well, I actually mentioned that I'm on Windows in my question :) Still, thanks for the explanation!
Ah, so you did...sorry I missed that detail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.