yarn icon indicating copy to clipboard operation
yarn copied to clipboard

Can't install package globally on Windows

Open wtchangdm opened this issue 10 years ago • 31 comments

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 [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" 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

wtchangdm avatar Oct 12 '16 11:10 wtchangdm

Hi

Same problem with Windows 7 Pro (x64)

kevincaradant avatar Oct 12 '16 12:10 kevincaradant

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 > [email protected]: 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 [email protected] 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.

gavinbarron avatar Oct 12 '16 16:10 gavinbarron

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

keysona avatar Oct 14 '16 03:10 keysona

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

davewallace avatar Oct 16 '16 01:10 davewallace

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 [email protected]: The platform "win32" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. warning [email protected]: 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

altyne avatar Oct 17 '16 05:10 altyne

source: [https://github.com/yarnpkg/yarn/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//)

altyne avatar Oct 17 '16 09:10 altyne

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

dheerajbhaskar avatar Nov 01 '16 19:11 dheerajbhaskar

I can also confirm this issue.

Node 6.9.1 Yarn 0.16.1 Windows Server 2012 R2 (x64)

jamesdixon avatar Nov 06 '16 22:11 jamesdixon

#1600 might be related

dheerajbhaskar avatar Nov 08 '16 05:11 dheerajbhaskar

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 [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" 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 [email protected] | win32 | x64
[-/3] ⠠ waiting...
[-/3] ⠠ waiting...
error Error running install script for optional dependency: <fsevents truncated>
success Installed [email protected] with binaries:
      - pm2
      - rundev
      - pm2-dev
      - pm2-docker
warning No license field
Done in 92.80s.

busches avatar Dec 01 '16 21:12 busches

Still unable to install global packages with 0.17.10

[4/4] Building fresh packages...
success Installed [email protected] with binaries:
      - gulp
warning No license field
error An unexpected error occurred: "EPERM: operation not permitted, open 'C:\\Program Files\\nodejs\\gulp.cmd'".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\brian\\AppData\\Local\\Yarn\\config\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
[4/4] Building fresh packages...
success Installed [email protected] with binaries:
      - bower
warning No license field
error An unexpected error occurred: "EPERM: operation not permitted, open 'C:\\Program Files\\nodejs\\bower.cmd'".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\brian\\AppData\\Local\\Yarn\\config\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

xt0rted avatar Dec 01 '16 21:12 xt0rted

@xt0rted that's a different error, as you're attempting to install into Program Files which requires admin access. You can run cmd as admin or change the prefix for yarn. Something like yarn config set prefix %AppData%\yarn.

busches avatar Dec 01 '16 21:12 busches

Hi, I've installed yarn@latest. pm2 was installed along with several errors and I can't use pm2 command at all.

I've upgraded node js to 7.2.0 though, not sure if it's related.

c:\>yarn --version
0.17.10
c:\>yarn global add pm2
yarn global v0.17.10
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
warning [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] ⢀ fsevents: C:\Users\**username**\AppData\Local\Yarn\config\global\node_modules\fsevents>if not defined npm_config_node_gyp (node "C:\Users\**username**\AppData\Roaming\npm\node_modules\yarn\bin\node-gyp-bin\\..\..\node_modules\node-gyp
[-/1] ⢀ waiting...
[-/1] ⢀ waiting...
[-/1] ⢀ waiting...
error Error running install script for optional dependency: "C:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents: Command failed.\nExit code: 1\nCommand: C:\\WINDOWS\\system32\\cmd.exe\nArguments: /d /s /c node-pre-gyp install --fallback-to-build\nDirectory: C:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\nOutput:\nnode-pre-gyp info it worked if it ends with ok\nnode-pre-gyp info using [email protected]\nnode-pre-gyp info using [email protected] | win32 | x64\nnode-pre-gyp info check checked for \"C:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\lib\\binding\\Release\\node-v51-win32-x64\\fse.node\" (not found)\nnode-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v51-win32-x64.tar.gz\nnode-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v51-win32-x64.tar.gz\nnode-pre-gyp ERR! Tried to download: https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v51-win32-x64.tar.gz \nnode-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v51 ABI) (falling back to source compile with node-gyp) \nnode-pre-gyp http Pre-built binary not available for your system, looked for https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v51-win32-x64.tar.gz \n\r\nC:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents>if not defined npm_config_node_gyp (node \"C:\\Users\\**username**\\AppData\\Roaming\\npm\\node_modules\\yarn\\bin\\node-gyp-bin\\\\..\\..\\node_modules\\node-gyp\\bin\\node-gyp.js\" clean )  else (node  clean ) \r\ngyp info it worked if it ends with ok\ngyp info using [email protected]\ngyp info using [email protected] | win32 | x64\ngyp info ok \n\r\nC:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents>if not defined npm_config_node_gyp (node \"C:\\Users\\**username**\\AppData\\Roaming\\npm\\node_modules\\yarn\\bin\\node-gyp-bin\\\\..\\..\\node_modules\\node-gyp\\bin\\node-gyp.js\" configure --fallback-to-build --module=C:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\lib\\binding\\Release\\node-v51-win32-x64\\fse.node --module_name=fse --module_path=C:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\lib\\binding\\Release\\node-v51-win32-x64 )  else (node  configure --fallback-to-build --module=C:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\lib\\binding\\Release\\node-v51-win32-x64\\fse.node --module_name=fse --module_path=C:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\lib\\binding\\Release\\node-v51-win32-x64 ) \r\ngyp info it worked if it ends with ok\ngyp info using [email protected]\ngyp info using [email protected] | win32 | x64\ngyp info spawn C:\\Python27\\python.exe\ngyp info spawn args [ 'C:\\\\Users\\\\**username**\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\yarn\\\\node_modules\\\\node-gyp\\\\gyp\\\\gyp_main.py',\ngyp info spawn args   'binding.gyp',\ngyp info spawn args   '-f',\ngyp info spawn args   'msvs',\ngyp info spawn args   '-G',\ngyp info spawn args   'msvs_version=auto',\ngyp info spawn args   '-I',\ngyp info spawn args   'C:\\\\Users\\\\**username**\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\fsevents\\\\build\\\\config.gypi',\ngyp info spawn args   '-I',\ngyp info spawn args   'C:\\\\Users\\\\**username**\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\yarn\\\\node_modules\\\\node-gyp\\\\addon.gypi',\ngyp info spawn args   '-I',\ngyp info spawn args   'C:\\\\Users\\\\**username**\\\\.node-gyp\\\\7.2.0\\\\include\\\\node\\\\common.gypi',\ngyp info spawn args   '-Dlibrary=shared_library',\ngyp info spawn args   '-Dvisibility=default',\ngyp info spawn args   '-Dnode_root_dir=C:\\\\Users\\\\**username**\\\\.node-gyp\\\\7.2.0',\ngyp info spawn args   '-Dnode_gyp_dir=C:\\\\Users\\\\**username**\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\yarn\\\\node_modules\\\\node-gyp',\ngyp info spawn args   '-Dnode_lib_file=node.lib',\ngyp info spawn args   '-Dmodule_root_dir=C:\\\\Users\\\\**username**\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\fsevents',\ngyp info spawn args   '--depth=.',\ngyp info spawn args   '--no-parallel',\ngyp info spawn args   '--generator-output',\ngyp info spawn args   'C:\\\\Users\\\\**username**\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\fsevents\\\\build',\ngyp info spawn args   '-Goutput_dir=.' ]\nTraceback (most recent call last):\r\n  File \"C:\\Users\\**username**\\AppData\\Roaming\\npm\\node_modules\\yarn\\node_modules\\node-gyp\\gyp\\gyp_main.py\", line 16, in <module>\r\n    sys.exit(gyp.script_main())\r\n  File \"C:\\Users\\**username**\\AppData\\Roaming\\npm\\node_modules\\yarn\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\__init__.py\", line 545, in script_main\r\n    return main(sys.argv[1:])\r\n  File \"C:\\Users\\**username**\\AppData\\Roaming\\npm\\node_modules\\yarn\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\__init__.py\", line 538, in main\r\n    return gyp_main(args)\r\n  File \"C:\\Users\\**username**\\AppData\\Roaming\\npm\\node_modules\\yarn\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\__init__.py\", line 523, in gyp_main\r\n    generator.GenerateOutput(flat_list, targets, data, params)\r\n  File \"C:\\Users\\**username**\\AppData\\Roaming\\npm\\node_modules\\yarn\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\generator\\msvs.py\", line 2003, in GenerateOutput\r\n    sln_projects, project_objects, flat=msvs_version.FlatSolution())\r\n  File \"C:\\Users\\**username**\\AppData\\Roaming\\npm\\node_modules\\yarn\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\generator\\msvs.py\", line 1762, in _GatherSolutionFolders\r\n    return _DictsToFolders('', root, flat)\r\n  File \"C:\\Users\\**username**\\AppData\\Roaming\\npm\\node_modules\\yarn\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\generator\\msvs.py\", line 1715, in _DictsToFolders\r\n    for folder, contents in bucket.iteritems():\r\nAttributeError: 'MSVSProject' object has no attribute 'iteritems'\r\ngyp ERR! configure error \ngyp ERR! stack Error: `gyp` failed with exit code: 1\ngyp ERR! stack     at ChildProcess.onCpExit (C:\\Users\\**username**\\AppData\\Roaming\\npm\\node_modules\\yarn\\node_modules\\node-gyp\\lib\\configure.js:305:16)\ngyp ERR! stack     at emitTwo (events.js:106:13)\ngyp ERR! stack     at ChildProcess.emit (events.js:191:7)\ngyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)\ngyp ERR! System Windows_NT 10.0.14393\ngyp ERR! command \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" \"C:\\\\Users\\\\**username**\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\yarn\\\\node_modules\\\\node-gyp\\\\bin\\\\node-gyp.js\" \"configure\" \"--fallback-to-build\" \"--module=C:\\\\Users\\\\**username**\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\fsevents\\\\lib\\\\binding\\\\Release\\\\node-v51-win32-x64\\\\fse.node\" \"--module_name=fse\" \"--module_path=C:\\\\Users\\\\**username**\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\fsevents\\\\lib\\\\binding\\\\Release\\\\node-v51-win32-x64\"\ngyp ERR! cwd C:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\ngyp ERR! node -v v7.2.0\ngyp ERR! node-gyp -v v3.4.0\ngyp ERR! not ok \nnode-pre-gyp ERR! build error \nnode-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=C:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\lib\\binding\\Release\\node-v51-win32-x64\\fse.node --module_name=fse --module_path=C:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\lib\\binding\\Release\\node-v51-win32-x64' (1)\nnode-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\\Users\\**username**\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\node_modules\\node-pre-gyp\\lib\\util\\compile.js:83:29)\nnode-pre-gyp ERR! stack     at emitTwo (events.js:106:13)\nnode-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)\nnode-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:885:16)\nnode-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)\nnode-pre-gyp ERR! System Windows_NT 10.0.14393\nnode-pre-gyp ERR! command \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" \"C:\\\\Users\\\\**username**\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\fsevents\\\\node_modules\\\\node-pre-gyp\\\\bin\\\\node-pre-gyp\" \"install\" \"--fallback-to-build\"\nnsuccess Installed [email protected] with binaries:
      - pm2
      - rundev
      - pm2-dev
      - pm2-docker
warning No license field
Done in 6.51s.

try to use pm2:

c:\>pm2 list
'pm2' is not recognized as an internal or external command

wtchangdm avatar Dec 02 '16 04:12 wtchangdm

I get the same error as @wtchangdm

λ yarn --version
0.17.10
λ yarn global add pm2
yarn global v0.17.10
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
warning [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[-/4] ⠈ waiting...
[-/4] ⠁ waiting...
[3/4] ⠁ fsevents: Failed to execute 'C:\Apps\nodejs\node.exe C:\Users\User.Name\AppData\Local\Yarn\
[-/4] ⠁ waiting...
error Error running install script for optional dependency: "C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents: Command failed.\nExit code: 1\nCommand: C:\\Windows\\system32\\cmd.exe\nArguments: /d /s /c node-pre-gyp install --fallback-to-build\nDirectory: C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\nOutput:\nnode-pre-gyp info it worked if it ends with ok\nnode-pre-gyp info using [email protected]\nnode-pre-gyp info using [email protected] | win32 | x64\nnode-pre-gyp info check checked for \"C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\lib\\binding\\Release\\node-v51-win32-x64\\fse.node\" (not found)\nnode-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.15/fse-v1.0.15-node-v51-win32-x64.tar.gz\nnode-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.15/fse-v1.0.15-node-v51-win32-x64.tar.gz\nnode-pre-gyp ERR! Tried to download: https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.15/fse-v1.0.15-node-v51-win32-x64.tar.gz \nnode-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v51 ABI) (falling back to source compile with node-gyp) \nnode-pre-gyp http Pre-built binary not available for your system, looked for https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.15/fse-v1.0.15-node-v51-win32-x64.tar.gz \ngyp info it worked if it ends with ok\ngyp info using [email protected]\ngyp info using [email protected] | win32 | x64\ngyp info ok \ngyp info it worked if it ends with ok\ngyp info using [email protected]\ngyp info using [email protected] | win32 | x64\ngyp info spawn C:\\Python27\\python.exe\ngyp info spawn args [ 'C:\\\\Users\\\\User.Name\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\node-gyp\\\\gyp\\\\gyp_main.py',\ngyp info spawn args   'binding.gyp',\ngyp info spawn args   '-f',\ngyp info spawn args   'msvs',\ngyp info spawn args   '-G',\ngyp info spawn args   'msvs_version=2015',\ngyp info spawn args   '-I',\ngyp info spawn args   'C:\\\\Users\\\\User.Name\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\fsevents\\\\build\\\\config.gypi',\ngyp info spawn args   '-I',\ngyp info spawn args   'C:\\\\Users\\\\User.Name\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\node-gyp\\\\addon.gypi',\ngyp info spawn args   '-I',\ngyp info spawn args   'C:\\\\Users\\\\User.Name\\\\.node-gyp\\\\7.2.0\\\\include\\\\node\\\\common.gypi',\ngyp info spawn args   '-Dlibrary=shared_library',\ngyp info spawn args   '-Dvisibility=default',\ngyp info spawn args   '-Dnode_root_dir=C:\\\\Users\\\\User.Name\\\\.node-gyp\\\\7.2.0',\ngyp info spawn args   '-Dnode_gyp_dir=C:\\\\Users\\\\User.Name\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\node-gyp',\ngyp info spawn args   '-Dnode_lib_file=node.lib',\ngyp info spawn args   '-Dmodule_root_dir=C:\\\\Users\\\\User.Name\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\fsevents',\ngyp info spawn args   '--depth=.',\ngyp info spawn args   '--no-parallel',\ngyp info spawn args   '--generator-output',\ngyp info spawn args   'C:\\\\Users\\\\User.Name\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\fsevents\\\\build',\ngyp info spawn args   '-Goutput_dir=.' ]\nTraceback (most recent call last):\r\n  File \"C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\node-gyp\\gyp\\gyp_main.py\", line 16, in <module>\r\n    sys.exit(gyp.script_main())\r\n  File \"C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\__init__.py\", line 545, in script_main\r\n    return main(sys.argv[1:])\r\n  File \"C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\__init__.py\", line 538, in main\r\n    return gyp_main(args)\r\n  File \"C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\__init__.py\", line 523, in gyp_main\r\n    generator.GenerateOutput(flat_list, targets, data, params)\r\n  File \"C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\generator\\msvs.py\", line 2003, in GenerateOutput\r\n
  sln_projects, project_objects, flat=msvs_version.FlatSolution())\r\n  File \"C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\generator\\msvs.py\", line 1762, in _GatherSolutionFolders\r\n    return _DictsToFolders('', root, flat)\r\n  File \"C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\generator\\msvs.py\", line 1715, in _DictsToFolders\r\n    for folder, contents in bucket.iteritems():\r\nAttributeError: 'MSVSProject' object has no attribute 'iteritems'\r\ngyp ERR! configure error \ngyp ERR! stack Error: `gyp` failed with exit code: 1\ngyp ERR! stack     at ChildProcess.onCpExit (C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\node-gyp\\lib\\configure.js:305:16)\ngyp ERR! stack     at emitTwo (events.js:106:13)\ngyp ERR! stack
at ChildProcess.emit (events.js:191:7)\ngyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)\ngyp ERR! System Windows_NT 6.1.7601\ngyp ERR! command \"C:\\\\Apps\\\\nodejs\\\\node.exe\" \"C:\\\\Users\\\\User.Name\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\node-gyp\\\\bin\\\\node-gyp.js\" \"configure\" \"--fallback-to-build\" \"--module=C:\\\\Users\\\\User.Name\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\fsevents\\\\lib\\\\binding\\\\Release\\\\node-v51-win32-x64\\\\fse.node\" \"--module_name=fse\" \"--module_path=C:\\\\Users\\\\User.Name\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\fsevents\\\\lib\\\\binding\\\\Release\\\\node-v51-win32-x64\" \"--python=C:\\\\tools\\\\Python27\\\\python.exe\" \"--msvs_version=2015\"\ngyp ERR! cwd C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\ngyp ERR! node -v v7.2.0\ngyp ERR! node-gyp -v v3.4.0\ngyp ERR! not ok \nnode-pre-gyp ERR! build error \nnode-pre-gyp ERR! stack Error: Failed to execute 'C:\\Apps\\nodejs\\node.exe C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\node-gyp\\bin\\node-gyp.js configure --fallback-to-build --module=C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\lib\\binding\\Release\\node-v51-win32-x64\\fse.node --module_name=fse --module_path=C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\lib\\binding\\Release\\node-v51-win32-x64 --python=C:\\tools\\Python27\\python.exe --msvs_version=2015' (1)\nnode-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\node_modules\\node-pre-gyp\\lib\\util\\compile.js:83:29)\nnode-pre-gyp ERR! stack     at emitTwo (events.js:106:13)\nnode-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)\nnode-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:885:16)\nnode-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)\nnode-pre-gyp ERR! System Windows_NT 6.1.7601\nnode-pre-gyp ERR! command \"C:\\\\Apps\\\\nodejs\\\\node.exe\" \"C:\\\\Users\\\\User.Name\\\\AppData\\\\Local\\\\Yarn\\\\config\\\\global\\\\node_modules\\\\fsevents\\\\node_modules\\\\node-pre-gyp\\\\bin\\\\node-pre-gyp\" \"install\" \"--fallback-to-build\"\nnode-pre-gyp ERR! cwd C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\nnode-pre-gyp ERR! node -v v7.2.0\nnode-pre-gyp ERR! node-pre-gyp -v v0.6.29\nnode-pre-gyp ERR! not ok \nFailed to execute 'C:\\Apps\\nodejs\\node.exe C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\node-gyp\\bin\\node-gyp.js configure --fallback-to-build --module=C:\\Users\\User.Name\\AppData\\Local\\Yarn\\config\\global\\node_modules\\fsevents\\lib\\binding\\Release\\node-v51-win32-x64\\fse.node --msuccess Installed [email protected] with binaries:
      - pm2
      - rundev
      - pm2-dev
      - pm2-docker
warning No license field
Done in 26.08s.

I have Windows 7 x64 / Node 7.2.0

zaggy avatar Dec 02 '16 10:12 zaggy

Errors from @zaggy and @wtchangdm seem to be from node-gyp. Last Two Stack Traces might not be a Yarn Error Do The packages Work Ehrn Installed With Npm?

Ps: Sorry About The Weird Capitalization. Something Is Not Working Well With Swiftkey And This Comment BOx On Github

dheerajbhaskar avatar Dec 02 '16 11:12 dheerajbhaskar

I have probably found what is the issue. It appears that when yarn installs modules globally it puts executables to this location: C:\Users\User.Name\AppData\Local\Yarn\config\global\node_modules\.bin And somehow when yarn was installed this location was not added to PATH (maybe because yarn was added using npm in my case). Adding mentioned folder to the PATH fixed the issue with missing executables issue for me.

zaggy avatar Dec 02 '16 12:12 zaggy

The above fix by @zaggy worked for me too.

What I noticed with the PATH on my laptop was that it contained C:\Users\User.Name\AppData\Local\Yarn\.bin, which in my case at least is a directory that doesn't exist and isn't created when adding new packages.

I should also note that I installed Yarn using the .msi file, so it's not just installing it via npm that causes this.

dylanparry avatar Dec 06 '16 11:12 dylanparry

@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

yanxyz avatar Dec 18 '16 05:12 yanxyz

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

skhamoud avatar Jan 03 '17 18:01 skhamoud

@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.

etrexel avatar Jan 05 '17 08:01 etrexel