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

[BUG]Cannot add global nodemon with yarn #3531

Closed
dsngo opened this issue May 30, 2017 · 5 comments
Closed

[BUG]Cannot add global nodemon with yarn #3531

dsngo opened this issue May 30, 2017 · 5 comments

Comments

@dsngo
Copy link

dsngo commented May 30, 2017

I am using the latest stable version of yarn 0.24.6 for windows
Do you want to request a feature or report a bug?

Recently, I used yarn to install nodemon on my windows 10x64,

What is the current behavior?
$ yarn add global nodemon yarn add v0.24.6 [1/4] Resolving packages... [2/4] Fetching packages... warning fsevents@1.1.1: The platform "win32" is incompatible with this module. info "fsevents@1.1.1" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. success Saved 143 new dependencies.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Install yarn.
  2. Open bash, type: yarn add global nodemon
  3. nodemon index.js.
  4. bash: command not found.

What is the expected behavior?
I expected it would have install nodemon globally like npm, but apparently it isn't.
I have tried to remove the nodemon package with yarn remove global nodemon and installed it again but nothing changed.
The package works normally with npm method.
Please mention your node.js, yarn and operating system version.
Latest node.js
Latest yarn
Windows 10 x64 with vscode.

@djenriquez
Copy link

djenriquez commented Jun 2, 2017

Hi, we're having issues with this version of yarn, 0.24.6, and nodemon also. Reverting back to 0.24.4 solves the problem, but otherwise yarn cannot find nodemon.

With the exact same package.json and code, we experience the following:

0.24.6

/app # yarn run serve
yarn run v0.24.6
$ nodemon ./server.js
sh: nodemon: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

0.24.4

/app # yarn run serve
yarn run v0.24.4
$ nodemon ./server.js
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node ./server.js`
Vault UI listening on: 8000

Reference:

@bestander
Copy link
Member

You need to add yarn global bin to your PATH.

@djenriquez, there are no changes between 0.24.4 and 0.24.6 that touch global or path https://github.com/yarnpkg/yarn/commits/0.24-stable.

@BYK
Copy link
Member

BYK commented Oct 27, 2017

Closing due to inactivity.

@BYK BYK closed this as completed Oct 27, 2017
@lucasdozie
Copy link

Like what @bestander said add yarn/bin to your system PATH, If you are planning to migrate from NPM to Yarn, make sure to add its path to the System variables to avoid any future error i.e 'name' not recognized

@andrewsosa
Copy link

andrewsosa commented Jun 22, 2018

I'd like to reopen this issue, I'm still having this problem. My yarn global bin directory is certainly in my PATH. I'm on macOS using zsh.

$ yarn global bin
/usr/local/bin

$ echo $PATH
/Users/andrew/.virtualenvs/cdt/bin:/Users/andrew/.bin:/usr/local/bin:/usr/bin:/bin:...
# shortened for brevity
# note /usr/local/bin is the third item

$ yarn global add nodemon
yarn global v1.7.0
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Installed "nodemon@1.17.5" with binaries:
      - nodemon
✨  Done in 5.08s.

$ nodemon
zsh: command not found: nodemon

$ which nodemon
nodemon not found

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

No branches or pull requests

6 participants