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

npm WARN config global-style This option has been deprecated in favor of --install-strategy=shallow #1175

Closed
1 task done
ericwq opened this issue Apr 3, 2023 · 3 comments · Fixed by #1179
Closed
1 task done

Comments

@ericwq
Copy link

ericwq commented Apr 3, 2023

I've searched open issues for similar requests

Yes

I've recently downloaded the latest plugin version of mason.nvim

  • Yes

Problem description

For test purpose, there is only one package (prettier) installed by mason. Here is the configuration for mason:

local options = {
  ensure_installed = { "prettier" }, 
  PATH = "skip",

  ui = {
    icons = {
      package_pending = "",
      package_installed = "",
      package_uninstalled = "",
    },

    keymaps = {
      toggle_server_expand = "<CR>",
      install_server = "i",
      update_server = "u",
      check_server_version = "c",
      update_all_servers = "U",
      check_outdated_servers = "C",
      uninstall_server = "X",
      cancel_installation = "<C-c>",
    },
  },

  max_concurrent_installers = 10,
}

After the successful installation of prettier, mason reports the following error.

#31 23.51 [mason] [INFO  05:19:30] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:166: Executing installer for Package(name=prettier) {}
#31 25.23 Wrote to /home/ide/.local/share/nvim/mason/.packages/prettier/package.json:
#31 25.23 {
#31 25.23   "name": "@mason/prettier",
#31 25.23   "version": "1.0.0",
#31 25.23   "description": "",
#31 25.23   "main": "index.js",
#31 25.23   "scripts": {
#31 25.24     "test": "echo \"Error: no test specified\" && exit 1"
#31 25.24   },
#31 25.24   "keywords": [],
#31 25.24   "author": "",
#31 25.24   "license": "ISC"
#31 25.24 }
#31 25.27 Initialized npm root
#31 27.95 [nvim-treesitter] [9/9] Treesitter parser for cpp has been installed
#31 31.43 added 1 package, and audited 2 packages in 5s
#31 31.43 1 package is looking for funding
#31 31.43   run `npm fund` for details
#31 31.43 found 0 vulnerabilities
#31 31.46 Error detected while processing command line:
#31 31.46 Error executing vim.schedule lua callback: /home/ide/.config/nvim/lua/core/bootstrap.lua:32: Vim:Error executing Lua callback: .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:39: Vim:Error executing Lua callback: /home/ide/.config/nvim/lua/plugins/init.lua:136: Vim:npm WARN config global-style This option has been deprecated in favor of `--install-strategy=shallow`
#31 31.46 stack traceback:
#31 31.46       [C]: in function 'cmd'
#31 31.46       /home/ide/.config/nvim/lua/plugins/init.lua:136: in function </home/ide/.config/nvim/lua/plugins/init.lua:135>
#31 31.46       [C]: in function 'cmd'
#31 31.46       .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:39: in function <.../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:16>
#31 31.46       [C]: in function 'cmd'
#31 31.46       /home/ide/.config/nvim/lua/core/bootstrap.lua:32: in function </home/ide/.config/nvim/lua/core/bootstrap.lua:31>
#31 31.46       [C]: in function 'wait'
#31 31.46       ...cal/share/nvim/lazy/lazy.nvim/lua/lazy/manage/runner.lua:153: in function 'wait'
#31 31.46       ...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/init.lua:60: in function 'run'
#31 31.46       ...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/init.lua:96: in function 'update'
#31 31.46       ...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/init.lua:182: in function 'command'
#31 31.46       ...cal/share/nvim/lazy/lazy.nvim/lua/lazy/view/commands.lua:23: in function 'cmd'
#31 31.46       ...cal/share/nvim/lazy/lazy.nvim/lua/lazy/view/commands.lua:95: in function <...cal/share/nvim/lazy/lazy.nvim/lua/lazy/view/commands.lua:85>
#31 31.46 stack traceback:
#31 31.46       [C]: in function 'cmd'
#31 31.46       .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:39: in function <.../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:16>
#31 31.46       [C]: in function 'cmd'
#31 31.46       /home/ide/.config/nvim/lua/core/bootstrap.lua:32: in function </home/ide/.config/nvim/lua/core/bootstrap.lua:31>
#31 31.46       [C]: in function 'wait'
#31 31.46       ...cal/share/nvim/lazy/lazy.nvim/lua/lazy/manage/runner.lua:153: in function 'wait'
#31 31.46       ...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/init.lua:60: in function 'run'
#31 31.46       ...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/init.lua:96: in function 'update'
#31 31.46       ...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/init.lua:182: in function 'command'
#31 31.46       ...cal/share/nvim/lazy/lazy.nvim/lua/lazy/view/commands.lua:23: in function 'cmd'
#31 31.46       ...cal/share/nvim/lazy/lazy.nvim/lua/lazy/view/commands.lua:95: in function <...cal/share/nvim/lazy/lazy.nvim/lua/lazy/view/commands.lua:85>
#31 31.46 stack traceback:
#31 31.46       [C]: in function 'cmd'
#31 31.46       /home/ide/.config/nvim/lua/core/bootstrap.lua:32: in function </home/ide/.config/nvim/lua/core/bootstrap.lua:31>
#31 31.46       [C]: in function 'wait'
#31 31.46       ...cal/share/nvim/lazy/lazy.nvim/lua/lazy/manage/runner.lua:153: in function 'wait'
#31 31.47       ...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/init.lua:60: in function 'run'
#31 31.47       ...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/init.lua:96: in function 'update'
#31 31.47       ...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/init.lua:182: in function 'command'
#31 31.47       ...cal/share/nvim/lazy/lazy.nvim/lua/lazy/view/commands.lua:23: in function 'cmd'
#31 31.47       ...cal/share/nvim/lazy/lazy.nvim/lua/lazy/view/commands.lua:95: in function <...cal/share/nvim/lazy/lazy.nvim/lua/lazy/view/commands.lua:85>
#31 31.47 [mason] [INFO  05:19:38] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:193: Installation succeeded for Package(name=prettier)#31 DONE 31.6s

Expected behavior

don't report the warning message:

#31 31.46 Error executing vim.schedule lua callback: /home/ide/.config/nvim/lua/core/bootstrap.lua:32: Vim:Error executing Lua callback: .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:39: Vim:Error executing Lua callback: /home/ide/.config/nvim/lua/plugins/init.lua:136: Vim:npm WARN config global-style This option has been deprecated in favor of `--install-strategy=shallow`

Affected packages

All

Mason output

see the problem description section.

Installation log

Here is the log


[INFO  Thu Mar 30 01:36:22 2023] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:166: Executing installer for Package(name=prettier) {}
[INFO  Thu Mar 30 01:36:27 2023] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:193: Installation succeeded for Package(name=prettier)
[ERROR Fri Mar 31 16:27:48 2023] ...im/lazy/mason.nvim/lua/mason-registry/sources/github.lua:177: Failed to install registry GitHubRegistrySource(repo=mason-org/mason-registry). "Failed to unpack registry contents:  bad CRC 3f35ec51  (should be 0b2761ba)\n"
[INFO  Fri Mar 31 16:34:52 2023] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:166: Executing installer for Package(name=prettier) {}
[INFO  Fri Mar 31 16:34:55 2023] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:193: Installation succeeded for Package(name=prettier)
[ERROR Mon Apr  3 13:31:01 2023] ...im/lazy/mason.nvim/lua/mason-registry/sources/github.lua:177: Failed to install registry GitHubRegistrySource(repo=mason-org/mason-registry). "Failed to unpack registry contents: unzip:  cannot find or open registry.json.zip, registry.json.zip.zip or registry.json.zip.ZIP.\n"
[INFO  Mon Apr  3 13:31:03 2023] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:166: Executing installer for Package(name=prettier) {}
[INFO  Mon Apr  3 13:31:06 2023] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:193: Installation succeeded for Package(name=prettier)


### Neovim version (>= 0.7)

$ nvim --version
NVIM v0.8.3
Build type: MinSizeRel
LuaJIT 2.1.0-beta3
Compiled by buildozer@build-edge-x86_64

Features: +acl +iconv +tui
See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info


### Operating system/version

``` $ uname -a Linux ssh-nvide 5.15.49-linuxkit #1 SMP Tue Sep 13 07:51:46 UTC 2022 x86_64 Linux ```

### Healthcheck

```Text
mason: require("mason.health").check()
========================================================================
## mason.nvim report
  - OK: neovim version >= 0.7.0
  - OK: Registry `require("mason-registry.index")` is installed.
  - OK: Registry `github.com/mason-org/mason-registry version: 2023-04-03-bawdy-sled` is installed.
  - OK: **unzip**: `UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send`
  - OK: **Go**: `go version go1.20.2 linux/amd64`
  - WARNING: **cargo**: not available
  - OK: **luarocks**: `/home/ide/.local/bin/luarocks 3.8.0`
  - WARNING: **Ruby**: not available
  - WARNING: **RubyGem**: not available
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - OK: **npm**: `9.6.2`
  - OK: **node**: `v18.15.0`
  - OK: **python3**: `Python 3.11.2`
  - OK: **pip3**: `pip 23.0.1 from /usr/lib/python3.11/site-packages/pip (python 3.11)`
  - WARNING: **javac**: not available
  - WARNING: **java**: not available
  - WARNING: **julia**: not available
  - OK: **wget**: `GNU Wget 1.21.3 built on linux-musl.`
  - OK: **curl**: `curl 8.0.1 (x86_64-alpine-linux-musl) libcurl/8.0.1 OpenSSL/3.1.0 zlib/1.2.13 brotli/1.0.9 nghttp2/1.52.0`
  - OK: **gzip**: `gzip 1.12`
  - OK: **tar**: `tar (GNU tar) 1.34`
  - WARNING: **pwsh**: not available
  - OK: **bash**: `GNU bash, version 5.2.15(1)-release (x86_64-alpine-linux-musl)`
  - OK: **sh**: `Ok`
  - OK: **python3_host_prog**: `Python 3.11.2`
  - OK: **python3_host_prog pip**: `pip 23.0.1 from /usr/lib/python3.11/site-packages/pip (python 3.11)`
  - OK: GitHub API rate limit. Used: 1. Remaining: 59. Limit: 60. Reset: Mon Apr  3 13:53:08 2023.


### Screenshots

_No response_
@williamboman
Copy link
Owner

Hello! The stack trace suggests the error comes from LunarVim core?

@ericwq
Copy link
Author

ericwq commented Apr 3, 2023

I use lazy.nvim to lazy load mason. If I don't install prettier, there is no warning message. After searched the global-style keyword in mason, the following files show it does set global-style in mason.

lua/mason-core/managers/npm/init.lua
55:    -- Use global-style. The reasons for this are:
63:    ctx.fs:append_file(".npmrc", "global-style=true")

lua/mason-core/installer/managers/npm.lua
21:        -- Use global-style. The reasons for this are:
30:            ctx.fs:append_file(".npmrc", "global-style=true")

The warning message is:

npm WARN config global-style This option has been deprecated in favor of `--install-strategy=shallow`

If you check the npm config document, global-style is deprecated. So use --install-strategy=shallow might be a right solution.

@williamboman
Copy link
Owner

Ah, gotcha. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants