Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception "Path must be a string" - Version 2.10.3 (Node 6) #329

Closed
codeuniquely opened this issue Mar 3, 2017 · 4 comments
Closed

Exception "Path must be a string" - Version 2.10.3 (Node 6) #329

codeuniquely opened this issue Mar 3, 2017 · 4 comments
Labels

Comments

@codeuniquely
Copy link

Just got a new Laptop (Mac Book Pro)

Doing a fresh fresh install of everything - Node, Npm, Git, Sublime Text, npm-check-updates, ...

Cloned my existing project
npm install - worked OK,

wanted to run ncu to see if it had installed any newer modules (compare to the project on my old MBP)

It threw this exception ....

Unhandled rejection TypeError: Path must be a string. Received null
    at assertPath (path.js:7:11)
    at Object.resolve (path.js:1146:7)
    at getPackageDataFromFile (/usr/local/lib/node_modules/npm-check-updates/lib/npm-check-updates.js:417:33)
    at programRunLocal (/usr/local/lib/node_modules/npm-check-updates/lib/npm-check-updates.js:407:19)
    at programRun (/usr/local/lib/node_modules/npm-check-updates/lib/npm-check-updates.js:356:50)
    at tryCatcher (/usr/local/lib/node_modules/npm-check-updates/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm-check-updates/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/usr/local/lib/node_modules/npm-check-updates/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/usr/local/lib/node_modules/npm-check-updates/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/usr/local/lib/node_modules/npm-check-updates/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/usr/local/lib/node_modules/npm-check-updates/node_modules/bluebird/js/release/promise.js:636:18)
    at Promise._resolveCallback (/usr/local/lib/node_modules/npm-check-updates/node_modules/bluebird/js/release/promise.js:431:57)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm-check-updates/node_modules/bluebird/js/release/promise.js:522:17)
    at Promise._settlePromise (/usr/local/lib/node_modules/npm-check-updates/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/usr/local/lib/node_modules/npm-check-updates/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/usr/local/lib/node_modules/npm-check-updates/node_modules/bluebird/js/release/promise.js:691:18)

node -v
V6.10.0
npm -v
3.10.10

My old MBP (which runs ncu just fine) has:

npm-check-updates .    V2.8.8
node                   V6.3.0
npm                    V3.10.3

As soon as I updated npm-check-updates to V2.10.3
it also failed ....

When I then downgraded by new MBP installation to V2.8.8
it started working.

@hueper
Copy link

hueper commented Mar 3, 2017

Hi @codeuniquely,

same has happened to me.
Then I recognised I've tried to run npm-check-updates from a directory without a package.json. When I run npm-check-updates from a directory with a package.json it works like expected :-)

@codeuniquely
Copy link
Author

Yes it crashes when you don't have a package.json in the folder that you're running it from.

but V2.8.8 doesn't crash when it executes in the same folder ....

and instead returns this message.

No package.json

Please add a package.json to the current directory, specify the --packageFile or --packageData options, or pipe a package.json to stdin.

@raineorshine
Copy link
Owner

Thanks for reporting! This appears to be a regression from #325.

@eighty4 Could you look into this? Must be a hole in the test coverage.

@raineorshine
Copy link
Owner

Fixed in PR #332 and published in v.2.10.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants