Skip to content

Can't install package globally on Windows #859

Description

@wtchangdm

Do you want to request a feature or report a bug?
bug

What is the current behavior?
unable to install package globally

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

yarn global add pm2

c:\>yarn global add pm2
yarn global v0.15.1
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.0.14: The platform "win32" is incompatible with this module.
info "fsevents@1.0.14" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
error ENOENT: no such file or directory, open 'C:\Users\***\AppData\Local\Yarn\.global\node_modules\abbrev\abbrev.js'
    at Error (native)
info Visit http://yarnpkg.com/en/docs/cli/global for documentation about this command.

What is the expected behavior?
install package like npm install -g pm2

Please mention your node.js, yarn and operating system version.
Windows 10 x64 Enterprise, version 1607 (build 14393.321)
node js 6.7.0
yarn 0.15.1

Activity

  1. changed the title [-]Can't install global package on Windows[/-] [+]Can't globally install package on Windows[/+] on Oct 12, 2016
  2. changed the title [-]Can't globally install package on Windows[/-] [+]Can't install package globally on Windows[/+] on Oct 12, 2016
  3. kevincaradant commented on Oct 12, 2016

    @kevincaradant

    Hi

    Same problem with Windows 7 Pro (x64)

  4. gavinbarron commented on Oct 12, 2016

    @gavinbarron

    Seems to be happening where there's a dependency on abbrev as this is also impacting installing yo

    > yarn global add yo
    yarn global v0.15.1
    warning No license field
    [1/4] Resolving packages...
    warning yo > fullname > npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
    [2/4] Fetching packages...
    [3/4] Linking dependencies...
    error ENOENT: no such file or directory, open 'C:\Users\gavinb\AppData\Local\Yarn\.global\node_modules\abbrev\abbrev.js'
        at Error (native)
    info Visit http://yarnpkg.com/en/docs/cli/global for documentation about this command.
    > node -v
    v4.5.0
    

    Windows 10 Build 14396

    Edit:

    I also tried manually installing abbrev:

    > yarn global add abbrev
    yarn global v0.15.1
    warning No license field
    [1/4] Resolving packages...
    [2/4] Fetching packages...
    [3/4] Linking dependencies...
    [4/4] Building fresh packages...
    warning abbrev@1.0.9 has no binaries
    Done in 2.92s.
    

    Looks like abbrev may be a package which builds it's native version on the machine when it's installed via npm.

  5. keysona commented on Oct 14, 2016

    @keysona

    Also in window10 (x64) , I can't globally install.

    In linking dependencies.

    This error:

    [3/4] Linking dependencies...
    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
    error ENOENT: no such file or directory, open 'C:\Users\keypy\AppData\Local\Yarn\.global\node_modules\abbrev\abbrev.js'
        at Error (native)
    
    # yarn -v
    v0.15.1
    
    # node -v
    v4.5.0
    
  6. davewallace commented on Oct 16, 2016

    @davewallace

    Same here; Win10x64, node -v v6.7.0, yarn -v v0.15.1, chokes on .global\node_modules\abbrev\abbrev.js.

  7. altyne commented on Oct 17, 2016

    @altyne

    same here when installing karma global.

    yarn global add are-we-there-yet
    yarn global v0.15.1
    warning No license field
    [1/4] Resolving packages...
    [2/4] Fetching packages...
    warning fsevents@1.0.14: The platform "win32" is incompatible with this module.
    info "fsevents@1.0.14" is an optional dependency and failed compatibility check. Excluding it from installation.
    warning benchmark@1.0.0: The engine "rhino" appears to be invalid.
    [3/4] Linking dependencies...
    error ENOENT: no such file or directory, open 'C:\Users\myUsername\AppData\Local\Yarn.global\node_modules\abbrev\abbrev.js'
    at Error (native)
    info Visit http://yarnpkg.com/en/docs/cli/global for documentation about this command.

    windows 8.1 enterprise x64
    node 4.5.0
    npm 2.15.9

  8. altyne commented on Oct 17, 2016

    @altyne

    source: [https://github.com//issues/1073#issuecomment-254158785]

    It resolve by modifying the registry:
    old value: https://registry.yarnpkg.com
    new value (fixed): https://registry.yarnpkg.com//

    add the double backlashes in registry. (yarn config set registry https://registry.yarnpkg.com//)

  9. dheerajbhaskar commented on Nov 1, 2016

    @dheerajbhaskar

    @altyne that didn't work got a error 500 on packages and install failed

  10. jamesdixon commented on Nov 6, 2016

    @jamesdixon

    I can also confirm this issue.

    Node 6.9.1
    Yarn 0.16.1
    Windows Server 2012 R2 (x64)

  11. dheerajbhaskar commented on Nov 8, 2016

    @dheerajbhaskar

    #1600 might be related

  12. busches commented on Dec 1, 2016

    @busches
    Contributor

    Can you reproduce this with yarn@latest? I'm not able to recreate the issue using the latest Yarn v0.17.10.

    yarn global add pm2
    yarn global v0.17.10
    warning No license field
    [1/4] Resolving packages...
    [2/4] Fetching packages...
    warning fsevents@1.0.15: The platform "win32" is incompatible with this module.
    info "fsevents@1.0.15" is an optional dependency and failed compatibility check. Excluding it from installation.
    [3/4] Linking dependencies...
    [4/4] Building fresh packages...
    [-/3] ⢀ waiting...
    [2/3] ⠠ fsevents: gyp info using node@6.9.1 | win32 | x64
    [-/3] ⠠ waiting...
    [-/3] ⠠ waiting...
    error Error running install script for optional dependency: <fsevents truncated>
    success Installed pm2@2.1.6 with binaries:
          - pm2
          - rundev
          - pm2-dev
          - pm2-docker
    warning No license field
    Done in 92.80s.
  13. 7 remaining items

  14. yanxyz commented on Dec 18, 2016

    @yanxyz

    @zaggy, if the installation command is run as administrator, it would be found that *.cmd files are put together with node.exe in c:\Program Files\nodejs。#1407

  15. skhamoud commented on Jan 3, 2017

    @skhamoud

    @yanxyz Same thing happens with gulp-cli , if installed w/ admin rights , any gulp command crashes the terminal in my case

  16. etrexel commented on Jan 5, 2017

    @etrexel

    @skhamoud Can confirm same issue. When yarn is installed from the msi installer and global packages are added from admin terminal, the resulting .cmd in C:\Program Files\nodejs for any package crashes the terminal.

  17. timfish commented on Jan 16, 2017

    @timfish

    The crashing of the terminal is fixed in the pre-release 0.19.0

  18. ForsakenHarmony commented on Apr 19, 2017

    @ForsakenHarmony

    yeah, it tries to install into C:\Program Files\nodejs for me as well by default

  19. Daniel15 commented on May 16, 2017

    @Daniel15
    Member

    This should be fixed in 0.24.x

  20. Daniel15 commented on May 27, 2017

    @Daniel15
    Member
  21. milesje commented on Jun 19, 2017

    @milesje

    Using Yarn installed via .msi installer (version 0.24.6), then ran yarn add global polymer-cli it installs fine but get error when trying to use polymer-cli.
    image

  22. AvinashGandhasiri commented on Jun 22, 2017

    @AvinashGandhasiri

    Installing npm modules globally din't work for me.
    I tried installing them in project folder and they worked fine.
    config:
    windows 10
    node.js 4.5.0
    npm 2.15.9
    run cmd as an administrator and look if the versions are latest and look for errors while running the command

  23. lewisl9029 commented on Aug 9, 2017

    @lewisl9029

    In my case, my path variable was set at %LocalAppData%\Yarn\.bin, when the actual folder was %LocalAppData%\Yarn\bin (without the . in front of bin).

    After removing the . everything worked fine again.

  24. Daniel15 commented on Aug 13, 2017

    @Daniel15
    Member

    @lewisl9029 - Which version of Yarn do you have? That should have been fixed in the installer for 0.24.0: 5fc8539

  25. lewisl9029 commented on Aug 13, 2017

    @lewisl9029

    @Daniel15 That makes sense. I installed Yarn quite a while ago so I wouldn't be surprised if I used an installer version prior to 0.24.0. Glad to know it should no longer be a problem for new users!

  26. dandv commented on Dec 6, 2017

    @dandv

    I have this issue on Linux. I've installed polymer-cli globally, but polymer isn't in the path.

    ~ yarn global add polymer-cli
    yarn global v1.3.2
    [1/4] Resolving packages...
    warning polymer-cli > bower@1.8.2: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
    warning polymer-cli > babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update! 
    warning polymer-cli > polyserve > @types/assert@0.0.29: See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/12826
    [2/4] Fetching packages...
    [3/4] Linking dependencies...
    [4/4] Building fresh packages...
    success Installed "polymer-cli@1.5.7" with binaries:
          - polymer
    Done in 25.08s.
    ➜  19:17 polymer
    zsh: command not found: polymer
    ➜  19:17 polymer-cli init
    zsh: command not found: polymer-cli
    ➜  19:17 yarn --version
    1.3.2
    
  27. Daniel15 commented on Dec 6, 2017

    @Daniel15
    Member

    @dandv - This issue is specific to Windows, as it was an issue with the MSI installer. Any Linux issues are unrelated. Please file a separate one.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions