-
-
Notifications
You must be signed in to change notification settings - Fork 28
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]: About Warn Failed to resolve global node_modules path. #386
Comments
I just ran into the same problem. This was also seen in #331 I fixed this by clearing my VS Code caches, and then restarting: # MacOS
rm -rf $HOME/Library/Application\ Support/Code/Cache/* $HOME/Library/Application\ Support/Code/CachedData/* I think the problem lies in the global path resolver using a stale cache value: vscode-stylelint/src/utils/packages/global-path-resolver.ts Lines 175 to 180 in b07fb50
|
I did this, but nothing changed, the warn is still there. |
I'm having this same issue on macOS 13.0.1 and also using NVM. I've installed the stylelint package locally and the VS Code Stylelint plugin works, but I still get the warning message. I've added |
I'm having this same issue on Windows 11 and using fnm, i‘m using |
I got this as well |
I have the same issue. I'm using PNPM modules. VS Code settings I use
Warning
Stylelint packages
Pnpm version: v7.17.1 Stylelint Version: v1.2.4 Node.js Version: v16.15.1 Operating System macOS 13.0.1 If I remove |
I think this is an environment variable error. I also used the fnm tool with windows 10, and decided to install node to the system and it worked for me. |
I am also receiving this error. I believe this to be caused by a breaking change from Yarn Classic to Yarn Modern: the I suspect that the desired new command for the case I highlighted above is |
I got this as well "dependencies": {
"postcss": "^8.4.16",
"postcss-less": "^6.0.0",
"postcss-html": "^1.6.0",
"postcss-scss": "^4.0.0",
"stylelint": "^16.2.1",
"stylelint-config-standard": "^36.0.0",
"stylelint-config-css-modules": "^4.4.0",
"stylelint-config-recess-order": "^5.0.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard-scss": "^13.0.0",
"stylelint-scss": "^6.2.1"
},
|
How did you encounter this bug?
I have not installed the global dependencies, the plugin has successfully run the relevant configuration through the installation in the project node_modules, but it still prompts me that the global dependencies are missing.
Code Snippet
No response
Stylelint Configuration
No response
Extension Configuration
No response
Actual Behaviour
I don't understand if this is a bug or a friendly prompt. 😯
Expected Behaviour
Maybe in my case it could have done without the hint.
Logs
[Info - 6:06:19 PM] [language-server] Registering module | module: "auto-fix"
[Info - 6:06:19 PM] [language-server] Module registered | module: "auto-fix"
[Info - 6:06:19 PM] [language-server] Registering module | module: "code-action"
[Info - 6:06:19 PM] [language-server] Module registered | module: "code-action"
[Info - 6:06:19 PM] [language-server] Registering module | module: "completion"
[Info - 6:06:19 PM] [language-server] Module registered | module: "completion"
[Info - 6:06:19 PM] [language-server] Registering module | module: "formatter"
[Info - 6:06:19 PM] [language-server] Module registered | module: "formatter"
[Info - 6:06:19 PM] [language-server] Registering module | module: "old-stylelint-warning"
[Info - 6:06:19 PM] [language-server] Module registered | module: "old-stylelint-warning"
[Info - 6:06:19 PM] [language-server] Registering module | module: "validator"
[Info - 6:06:19 PM] [language-server] Module registered | module: "validator"
[Info - 6:06:19 PM] [language-server] Starting language server
[Info - 6:06:19 PM] [language-server] Registering handlers
[Info - 6:06:19 PM] [language-server] Handlers registered
[Info - 6:06:19 PM] [language-server] Language server started
[Warn - 6:06:20 PM] [language-server] Failed to resolve global node_modules path. | packageManager: "npm" error: {"errno":-2,"code":"ENOENT","syscall":"spawn npm","path":"npm","spawnargs":["config","get","prefix"],"name":"Error","message":"spawn npm ENOENT","stack":"Error: spawn npm ENOENT\n at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)\n at onErrorNT (internal/child_process.js:465:16)\n at processTicksAndRejections (internal/process/task_queues.js:80:21)"}
[Warn - 6:06:20 PM] [language-server] Failed to resolve global node_modules path. | packageManager: "npm" error: {"errno":-2,"code":"ENOENT","syscall":"spawn npm","path":"npm","spawnargs":["config","get","prefix"],"name":"Error","message":"spawn npm ENOENT","stack":"Error: spawn npm ENOENT\n at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)\n at onErrorNT (internal/child_process.js:465:16)\n at processTicksAndRejections (internal/process/task_queues.js:80:21)"}
[Warn - 6:06:20 PM] [language-server] Failed to resolve global node_modules path. | packageManager: "npm" error: {"errno":-2,"code":"ENOENT","syscall":"spawn npm","path":"npm","spawnargs":["config","get","prefix"],"name":"Error","message":"spawn npm ENOENT","stack":"Error: spawn npm ENOENT\n at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)\n at onErrorNT (internal/child_process.js:465:16)\n at processTicksAndRejections (internal/process/task_queues.js:80:21)\n at runNextTicks (internal/process/task_queues.js:62:3)\n at processImmediate (internal/timers.js:434:9)"}
/Users/saszr/Coding/Github/rfmo/src/global.less: When linting something other than CSS, you should install an appropriate syntax, e.g. "postcss-less", and use the "customSyntax" option
/Users/saszr/Coding/Github/rfmo/src/global.less: When linting something other than CSS, you should install an appropriate syntax, e.g. "postcss-less", and use the "customSyntax" option
Stylelint Version
v14.6.0
vscode-stylelint Version
v1.2.2
Node.js Version
v16.13.1
Operating System
macOS 12.0.1
Windows Subsystem for Linux
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: