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

Can't install package globally on Windows #859

Closed
wtchangdm opened this issue Oct 12, 2016 · 31 comments

Comments

@wtchangdm
Copy link

commented Oct 12, 2016

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

@wtchangdm wtchangdm changed the title Can't install global package on Windows Can't globally install package on Windows Oct 12, 2016

@wtchangdm wtchangdm changed the title Can't globally install package on Windows Can't install package globally on Windows Oct 12, 2016

@kevincaradant

This comment has been minimized.

Copy link

commented Oct 12, 2016

Hi

Same problem with Windows 7 Pro (x64)

@gavinbarron

This comment has been minimized.

Copy link

commented Oct 12, 2016

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.

@keysona

This comment has been minimized.

Copy link

commented Oct 14, 2016

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

@sebmck sebmck added the needs triage label Oct 14, 2016

@Daniel15 Daniel15 added cat-bug and removed needs triage labels Oct 15, 2016

@davewallace

This comment has been minimized.

Copy link

commented Oct 16, 2016

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

@altyne

This comment has been minimized.

Copy link

commented Oct 17, 2016

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

@altyne

This comment has been minimized.

Copy link

commented Oct 17, 2016

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//)

@dheerajbhaskar

This comment has been minimized.

Copy link

commented Nov 1, 2016

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

@jamesdixon

This comment has been minimized.

Copy link

commented Nov 6, 2016

I can also confirm this issue.

Node 6.9.1
Yarn 0.16.1
Windows Server 2012 R2 (x64)

@dheerajbhaskar

This comment has been minimized.

Copy link

commented Nov 8, 2016

#1600 might be related

@busches

This comment has been minimized.

Copy link
Contributor

commented Dec 1, 2016

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

This comment has been minimized.

Copy link

commented Dec 1, 2016

Still unable to install global packages with 0.17.10

[4/4] Building fresh packages...
success Installed gulp@3.9.1 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 bower@1.8.0 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.
@busches

This comment has been minimized.

Copy link
Contributor

commented Dec 1, 2016

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

@wtchangdm

This comment has been minimized.

Copy link
Author

commented Dec 2, 2016

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 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...
[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 node-pre-gyp@0.6.29\nnode-pre-gyp info using node@7.2.0 | 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 fsevents@1.0.14 and node@7.2.0 (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 node-gyp@3.4.0\ngyp info using node@7.2.0 | 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 node-gyp@3.4.0\ngyp info using node@7.2.0 | 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 pm2@2.1.6 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
@zaggy

This comment has been minimized.

Copy link

commented Dec 2, 2016

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 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...
[-/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 node-pre-gyp@0.6.29\nnode-pre-gyp info using node@7.2.0 | 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 fsevents@1.0.15 and node@7.2.0 (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 node-gyp@3.4.0\ngyp info using node@7.2.0 | win32 | x64\ngyp info ok \ngyp info it worked if it ends with ok\ngyp info using node-gyp@3.4.0\ngyp info using node@7.2.0 | 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 pm2@2.1.6 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

@dheerajbhaskar

This comment has been minimized.

Copy link

commented Dec 2, 2016

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

@zaggy

This comment has been minimized.

Copy link

commented Dec 2, 2016

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.

@dylanparry

This comment has been minimized.

Copy link

commented Dec 6, 2016

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.

@yanxyz

This comment has been minimized.

Copy link

commented Dec 18, 2016

@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

@skhamoud

This comment has been minimized.

Copy link

commented Jan 3, 2017

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

@etrexel

This comment has been minimized.

Copy link

commented Jan 5, 2017

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

@timfish

This comment has been minimized.

Copy link

commented Jan 16, 2017

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

@ForsakenHarmony

This comment has been minimized.

Copy link

commented Apr 19, 2017

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

@Daniel15

This comment has been minimized.

Copy link
Member

commented May 16, 2017

This should be fixed in 0.24.x

@Daniel15 Daniel15 closed this May 16, 2017

@Daniel15

This comment has been minimized.

Copy link
Member

commented May 27, 2017

@milesje

This comment has been minimized.

Copy link

commented Jun 19, 2017

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

@AvinashGandhasiri

This comment has been minimized.

Copy link

commented Jun 22, 2017

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

@lewisl9029

This comment has been minimized.

Copy link

commented Aug 9, 2017

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.

@Daniel15

This comment has been minimized.

Copy link
Member

commented Aug 13, 2017

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

@lewisl9029

This comment has been minimized.

Copy link

commented Aug 13, 2017

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

@dandv

This comment has been minimized.

Copy link

commented Dec 6, 2017

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

This comment has been minimized.

Copy link
Member

commented Dec 6, 2017

@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
Projects
None yet
You can’t perform that action at this time.