tylerlong / yarn-upgrade-all

This is a command line utility program to upgrade all the packages in your `package.json` to the latest version (potentially upgrading packages across major versions).
96 stars 7 forks source link

'yarn-upgrade-all' is not recognized as an internal or external command #1

Closed Deilan closed 7 years ago

Deilan commented 7 years ago

Trying to use after install:

'yarn-upgrade-all' is not recognized as an internal or external command, operable program or batch file.

tylerlong commented 7 years ago

Install it globally: yarn global add yarn-upgrade-all.

If you install it locally, you need to ./node_modules/.bin/yarn-upgrade-all.

Deilan commented 7 years ago

@tylerlong I did install it globally. It doesn't work after that.

image

tylerlong commented 7 years ago

@Deilan I don't use Windows and I didn't test it on windows.

I guess you will have issues with all node command line libraries, not only yarn-upgrade-all.

Please read this thread: https://stackoverflow.com/questions/9587665/nodejs-cannot-find-installed-module-on-windows

Let me know if it works.

Deilan commented 7 years ago

@tylerlong Nope, I don't have any problems with any of popular and ubiquitous npm modules globally installed on Windows. Moreover, I didn't have to make any additional actions upon installing them to make them work right after install. grunt, gulp, yarn, tsc, tslint are just some of them and they work quite well.

tylerlong commented 7 years ago

I am not sure I have fixed the issue but I've released a new version. Could you please have a try?

Here is the change: https://github.com/tylerlong/yarn-upgrade-all/commit/9f03841052bed506f50d34a56f47b23bbbcac31d

I think changing

"bin": "index.js"

to

"bin": {
  "yarn-upgrade-all": "./index.js"
},

might fix the issue.

tylerlong commented 7 years ago

I just tried and it worked:

PS C:\Users\tyler\AppData\Local\Yarn\bin> npm install -g yarn-upgrade-all
C:\Users\tyler\AppData\Local\scoop\apps\nodejs\6.7.0\nodejs\yarn-upgrade-all -> C:\Users\tyler\AppData\Local\scoop\apps\nodejs\6.7.0\nodejs\node_modules\yarn-upgrade-all\index.js
C:\Users\tyler\AppData\Local\scoop\apps\nodejs\6.7.0\nodejs
`-- yarn-upgrade-all@0.1.6
  `-- chalk@2.1.0
    +-- ansi-styles@3.2.0
    | `-- color-convert@1.9.0
    |   `-- color-name@1.1.3
    +-- escape-string-regexp@1.0.5
    `-- supports-color@4.2.1
      `-- has-flag@2.0.0

PS C:\Users\tyler\AppData\Local\Yarn\bin> yarn-upgrade-all.cmd
Error: Cannot find package.json file in the current directory
PS C:\Users\tyler\AppData\Local\Yarn\bin>

However yarn global add ... won't work which I believe is yarn's bug. There is an open issue: https://github.com/yarnpkg/yarn/issues/2224