Let's make sure that we can initialize projects using npm.

Create Temporary Directory
🐞 Gotcha -- This directory must not be in protected area of computer -- e.g., in Windows it should not be under "C:\Program Files", "C:\Windows", ...

Let us create test directory "C:\Work\NpmSanityTest".
Or on MAC/unix, "\Work\NpmSanityTest".
C:\Work\NpmCheck
Open Console and Navigate to Test Directory
  • Open console
  • Navigate to "NpmSanityTest" directory

Our console should look similar to the one shown here
C:\Work\NpmSanityTest>
Check Write Access
Let's write a file to be doubly sure we have write access.

Do the commands shown and make sure you see the file content "hello"
> echo hello > out.txt
> type out.txt
hello
Try NPM
Let's run npm without any prompts as the simplest test.

Run the command shown.

The "-y" flag simply means that we accept the default for every npm prompt (we bypass prompts).

NOTE WELL -- our console should remain in the test dir "C:\Work\NpmSanityTest" for all of this work.
> npm -y init
hello
Check Results
Do the "dir" command (or "ls" for MAC/unix).

We should see "package.json" in the listing.
> dir
03/19/2021  11:18 AM 244 package.json