mysticatea / npm-run-all

A CLI tool to run multiple npm-scripts in parallel or sequential.
MIT License
5.72k stars 240 forks source link

pathType.dir is not a function #190

Closed caleb15 closed 3 years ago

caleb15 commented 3 years ago
(py3) fifteen5@web-long0.cloud51:/srv/app$ /srv/app/node_modules/.bin/npm-run-all foo
ERROR: pathType.dir is not a function

(note that "foo" is not a real command)

Github search doesn't return any results for "pathType"

I grepped for pathType in the module and found this:

(py3) fifteen5@web-long0.cloud51:/srv/app$ grep -R pathType /srv/app/node_modules/npm-run-all
/srv/app/node_modules/npm-run-all/node_modules/read-pkg/index.js:const pathType = require('path-type');
/srv/app/node_modules/npm-run-all/node_modules/read-pkg/index.js:   return pathType.dir(fp)
/srv/app/node_modules/npm-run-all/node_modules/read-pkg/index.js:   fp = pathType.dirSync(fp) ? path.join(fp, 'package.json') : fp;
(py3) fifteen5@web-long0.cloud51:/srv/app$ node --version
v14.15.0

read-pkg is required by lib/read-package-json which is required by lib/index.js

Unfortunately brew doesn't have a node 14 formula just yet so I can't install node14 via brew. Once I install node14 I'll give this a test locally and see if it also errors out there.

caleb15 commented 3 years ago

I destroyed the node_modules directory, reinstalled, and the error no longer happens. I think the error happened because node_modules still had node@v12 modules.