0

I'm creating a new Vue project via npm init vue@latest and select everything (Eslint with Prettier)

I'm using the following setup

  • OS: Win11
  • node: v17.4
  • npm: v8.4

After creating a new project via PowerShell I open up Visual Studio Code and use its terminal window.


I tried the following using PowerShell, CMD and Git Bash inside VSC


I want to use lint-staged, based on the docs I run npx mrm@2 lint-staged which works fine but generates a file with a single number with no file extension

enter image description here

The content of this file is

added 583 packages, and audited 584 packages in 35s

86 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

I have to delete the file manually so that no one pushes it by mistake. Does someone know why this happens and how I can prevent that?

1 Answers1

0

mrm's lint-staged preset attempts to install husky and lint-staged, using >= version specifiers, as in:

npm install -D lint-staged@>=10 husky@>=6
                                      

The last > symbol in the command causes a redirection to a file of the specified name (in this case, it's named 6) in certain Windows shells, including CMD, Git Bash, and PowerShell. WSL is not affected by this problem.

You can workaround the issue in PowerShell by manually installing those dependencies beforehand with the problematic arguments surrounded by triple-quotes:

npm i -D """lint-staged@>=10""" """husky@>=6"""

Then, when you run npx mrm@2 lint-staged, mrm will skip the installation of those packages (bypassing the problem), and perform the rest of the preset steps.

tony19
  • 125,647
  • 18
  • 229
  • 307