mrm icon indicating copy to clipboard operation
mrm copied to clipboard

`npx mrm lint-staged` doesn't work on Windows

Open vvscode opened this issue 3 years ago • 4 comments

$ npx mrm lint-staged
npx: installed 298 in 23.876s
C:\Users\Elvira\AppData\Roaming\npm-cache\_npx\13864\node_modules\mrm\bin\mrm.js:55
                throw err;
                ^
Error: Cannot find module 'C:\Users\Elvira\AppData\Roaming\npm-cache\_npx\13864\lib\node_modules\mrm-task-lint-staged'
Require stack:
- C:\Users\Elvira\AppData\Roaming\npm-cache\_npx\13864\node_modules\mrm\src\index.js
- C:\Users\Elvira\AppData\Roaming\npm-cache\_npx\13864\node_modules\mrm\bin\mrm.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at C:\Users\Elvira\AppData\Roaming\npm-cache\_npx\13864\node_modules\mrm\src\index.js:163:18
    at new Promise (<anonymous>)
    at runTask (C:\Users\Elvira\AppData\Roaming\npm-cache\_npx\13864\node_modules\mrm\src\index.js:153:9)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\Elvira\\AppData\\Roaming\\npm-cache\\_npx\\13864\\node_modules\\mrm\\src\\index.js',
    'C:\\Users\\Elvira\\AppData\\Roaming\\npm-cache\\_npx\\13864\\node_modules\\mrm\\bin\\mrm.js'
  ]
}

vvscode avatar May 04 '21 18:05 vvscode

issue solved with a local installation of mrm and mrm-task-lint-staged

npm install mrm mrm-task-lint-staged --save-dev
npx mrm lint-staged
npm uninstall mrm mrm-task-lint-staged

but it's nice to have package-level fix

vvscode avatar May 04 '21 18:05 vvscode

Running into this as well. Would be nice to see a fix! I also see lint-staged solved it in their docs by hard-coding and using mrm@2 instead: https://github.com/okonet/lint-staged/commit/4f9a146708862b06d19c7627f4dd1b094b2b88ce

Will be using mrm@2 myself until v3 is working ✌

akd-io avatar Jun 30 '21 22:06 akd-io

issue solved with a local installation of mrm and mrm-task-lint-staged

npm install mrm mrm-task-lint-staged --save-dev
npx mrm lint-staged
npm uninstall mrm mrm-task-lint-staged

but it's nice to have package-level fix

Seeing the same issue, this worked for me ⬆️

camilo86 avatar Jul 01 '21 20:07 camilo86

My personal encounter with this error is due to the fact that I use nvm instead of a single source of node. The installation directory for nvm on Windows is C:\Program Files\nodejs. Haven't determined if this is something that I will have to configure locally with nvm or original installation of npm and the npx command, if that is indeed the case.

ghughes27 avatar Jul 16 '21 20:07 ghughes27