How to fix vscode warning module not installed when using pnpm - pnpm

mkdir a-1 && cd a-1
pnpm init
pnpm i eslint --save-dev
code .
I opened this project in vscode on windows 10 and vscode showed these warnings.
Module '.pnpm' is extraneous
Module '#eslint/eslintrc' is extraneous
Module 'eslint-scope' is extraneous
Module 'eslint-utils' is extraneous
Module 'eslint' is not installed
I know this doesn't affect the project, but is there any way to go about hiding this warning.

Open the settings menu (Ctrl+, - Windows / Cmd+, - Mac), and navigate to the Npm: Package Manager field. Change the value in the dropdown to pnpm.
Afterwards, open the command palette (Ctrl+Shift+P, - Windows / Cmd+Shift+P, - Mac) and choose Developer: Reload Window.

Related

How to setup VSCode for golang/go cmd module?

It works well for std module (golang/go root directory) on VSC. However it doesn't work on cmd module (opened from src/cmd directory). There were no code navigation, symbol search, and even any problems/errors reported.
Version info:
vscode: 1.61.0
vscode-go: v0.28.1
Installed go tools:
gopkgs
go-outline
gotests
gomodifytags
impl
goplay
dlv
dlv-dap
staticcheck
gopls
Open VSC from $WORKSPACE/go. Follow the instruction of https://github.com/golang/tools/blob/master/gopls/doc/advanced.md#working-on-the-go-source-distribution as #hana mentioned:
Compile the Go binary. Change working directory to $WORKSPACE/go/src and run ./make.bash (or ./make.bat for Windows cmd). It will generate the $WORKSPACE/go/bin directory.
Set "go.goroot" to "${workspaceFolder}" and install all Go tools required.

VS Code Go: $GOPATH/go.mod exists but should not

I'm trying to use the Go features of VS Code (like 'Go to definition') in a package with a go.mod. However, if I go into the repository's main directory (with the go.mod) and code ., I get this error:
Error loading workspace folders (expected 1, got 0) failed to load view for file:///Users/kurt/Documents/http-enrollment-portal: err: exit status 1: stderr: $GOPATH/go.mod exists but should not
I've read that I might have to update the gopls language server, so I pressed Cmd + Shift + P and selected "Go: Install/Update Tools" and selected gopls; however, this gives me the same error:
go.toolsGopath setting is not set. Using GOPATH /Users/kurt/Documents/http-enrollment-portal:/Users/kurt/go
Installing 1 tool at /Users/kurt/Documents/http-enrollment-portal/bin in module mode.
gopls
Installing golang.org/x/tools/gopls FAILED
1 tools failed to install.
gopls:
Error: Command failed: /usr/local/opt/go#1.12/bin/go get -v golang.org/x/tools/gopls
$GOPATH/go.mod exists but should not
$GOPATH/go.mod exists but should not
The strange thing is that 'Go to definition' does work in other repositories. I suppose a possible solution is to set the go.toolsGopath?
go env -w GOPATH=
GOPATH and Modules
this link
When using modules, GOPATH is no longer used for resolving imports. However, it is still used to store downloaded source code (in GOPATH/pkg/mod) and compiled commands (in GOPATH/bin).
I had a similar issue. So to explain I am using https://www.mongodb.com/blog/post/quick-start-golang-mongodb-starting-and-setup
To try Mongodb with Go. In VS Code I first installed go mod init quickstart
Then I used go get go.mongodb.org/mongo-driver and got the error $GOPATH/go.mod exists but should not.
I had previously set my GOPATH according to https://www.freecodecamp.org/news/setting-up-go-programming-language-on-windows-f02c8c14e2f/ (see Phase 3 on this page).
I went into my Windows Environment Variables and deleted my GOPATH. On the Windows 10 start menu go to System then Advanced system settings under the Advanced tab click the Environment Variables button and I deleted my GOPATH variable.
Next back in VS Code I again try go get go.mongodb.org/mongo-driver and it works.
you have to go to the folder where you created your go project and delete the go.mod file after you create another file with the command : go mod init nameproject on your command prompt (power

how to install sass on windows

I cannot install Sass to my machine although I had downloaded ruby and printed on cmd :
cd C:/ruby22
then:
gem install sass
but I get as result:
'gem' is not recognized as an internal command, operable program or batch file
how to install it please?
You can install Sass on Windows by downloading the package for your operating system from GitHub select latest release
extract the downloaded zip file
Now note download the extracted zip file path. For example D:\MyUserName\dart-sass
Set system environment variable. Step depends which version of
Windows you're using:
If you're using Windows 8 or 10, press the Windows key, then search
for and select "System (Control Panel)".
If you're using Windows 7, right click the "Computer" icon on the
desktop and click "Properties". Click "Advanced system settings".
Click "Environment Variables".
Under "System Variables", find the PATH variable, select it, and
click "Edit". If there is no PATH variable, click "New".
Add your directory to the beginning of the variable value followed
by ; (a semicolon). For example, if the value was
C:\Windows\System32, change it to
C:\Users\Me\bin;C:\Windows\System32.
Click "OK".
That's all—there are no external dependencies and nothing else you need to install.
now open command prompt
run sass --version
to be sure it installed correctly.
When you install Sass on the command line, you'll be able to run the sass executable to compile .sass and .scss files to .css files. For example:
sass --watch input.scss output.css
Once it's all set up, Sass Basics.
how i am converting .scss to .css
i have created a windows batch file in my project/content/scss folder(where all my scss files are) with below commands.
cd.. (When you need to go one folder up, use the "cd.." command.)
sass --watch scss\:scss\ (You can also watch individual files or
directories with the --watch flag.)
saved it as
watch scss.bat
now whenever i am working on my sass file i run the "watch scss.bat"
the above command execute and watch my all my .scss files and update .css file for the same:)
Install ruby, see: https://github.com/oneclick/rubyinstaller/wiki
Open a command prompt, click Start, click Run, type cmd, and then click OK.
Run gem install sass
Possible related to your issue: https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#not-recognized-as-an-internal-or-external-command-operable-program-or-batch-file
This is for Windows
First step is to download ruby, install it, then add it to your executable path.
Now go to your folder where ruby was installed and check if it was installed with ruby -v command.
Then, open the folder where you have installed ruby and install sass using gem install sass.
That's it!! You are good to go!! If you still have doubts, run sass -v and it will give you a version.
For Mac
Just run gem install sass as ruby is preinstalled on Mac.
Step 1: https://rubyinstaller.org/ using CMD [gem install sass]
Step 2: http://compass-style.org/install/ using CMD
[gem update --system] [gem install compass]
for more details https://github.com/iz-syed/base_path/blob/master/README.md

How to properly install Cabal 1.18.02 in Windows 7?

I'm trying to install the new Cabal in Windows 7. It successfully installs 1.18.02, but when I run "cabal --version" it shows 1.16. The folder C:\Users\me\AppData\Roaming\cabal\bin is at the front of my PATH.
When I directly run the 1.18 executable, I get a bunch of "cabal.exe does not exist" errors.
How can I configure Cabal to use version 1.18 by default?
There is a path conflict due the way haskell platform installs cabal.exe
As seen in this ticket
To fix it:
Delete `C:/program files(x86)/Haskell platform/lib/extralibs/bin/cabal.exe.`
In any case, you can use search tool to find which cabal.exe to delete.
I used cabal-dev to install cabal 1.18 to a sandbox, such that C:\cabal-dev\cabal-dev\bin contains the latest (1.18) cabal executable. I then set C:\Cabal-dev\cabal-dev\bin as the first Variable value in the "Path" variable in "systems variables" (as opposed to the "PATH" variable in "user variables"). That worked for me, and allowed me to keep the older build of cabal intact, (in case its needed later).
It worked for me. Good luck. Here are my exact steps:
Install cabal-dev
open command prompt anywhere
execute following command: “cabal install cabal-dev”
Install new cabal
create directory: c:\cabal-dev, cd to it
execute following command: “cabal-dev install cabal-install”
Set new, upgraded cabal path as higher priority
Close any open command prompts
run: Sysdm.cpl
Go to the “Advanced” tab
Click “Environment Variables”
Select the “Path” variable listed in the “System variables” (lower) windows
Click edit
Add following string to the beginning of the variable value:
“C:\Cabal-dev\cabal-dev\bin;”
Ok, Ok, Ok
Ensure latest cabal is being run:
Open command prompt (anywhere except c:\cabal-dev\ *)
execute following command: “cabal –V”
cabal version should be 1.18.0.2
One other possible cause of this error (aside from the cabal in extralibs problem described in another answer) is that the ld in your path can't read the .o files that GHC produces.
I hit this problem with GHC 7.8.1 RC1, and could see this going wrong by running cabal install with -v3. The 'ld' on my path was coming from Haskell Platform 2013.2.0.0.
Adding mingw\bin from the new GHC's directory to the path fixed the problem.

How to use npm with node.exe?

I have downloaded Windows Binary (.exe) of nodejs from the main page.
How can I install and use npm (Node package manager)?
The current windows installer from nodejs.org as of v0.6.11 (2012-02-20) will install NPM along with NodeJS.
NOTES:
At this point, the 64-bit version is your best bet
The install path for 32-bit node is "Program Files (x86)" in 64-bit windows.
You may also need to add quotes to the path statement in environment variables, this only seems to be in some cases that I've seen.
In Windows, the global install path is actually in your user's profile directory
%USERPROFILE%\AppData\Roaming\npm
%USERPROFILE%\AppData\Roaming\npm-cache
WARNING: If you're doing timed events or other automation as a different user, make sure you run npm install as that user. Some modules/utilities should be installed globally.
INSTALLER BUGS: You may have to create these directories or add the ...\npm directory to your users path yourself.
To change the "global" location for all users to a more appropriate shared global location %ALLUSERSPROFILE%\(npm|npm-cache) (do this as an administrator):
create an [NODE_INSTALL_PATH]\etc\ directory
this is needed before you try npm config --global ... actions
create the global (admin) location(s) for npm modules
C:\ProgramData\npm-cache - npm modules will go here
C:\ProgramData\npm - binary scripts for globally installed modules will go here
C:\ProgramData\npm\node_modules - globally installed modules will go here
set the permissions appropriately
administrators: modify
authenticated users: read/execute
Set global configuration settings (Administrator Command Prompt)
npm config --global set prefix "C:\ProgramData\npm"
npm config --global set cache "C:\ProgramData\npm-cache"
Add C:\ProgramData\npm to your System's Path environment variable
If you want to change your user's "global" location to %LOCALAPPDATA%\(npm|npm-cache) path instead:
Create the necessary directories
C:\Users\YOURNAME\AppData\Local\npm-cache - npm modules will go here
C:\Users\YOURNAME\AppData\Local\npm - binary scripts for installed modules will go here
C:\Users\YOURNAME\AppData\Local\npm\node_modules - globally installed modules will go here
Configure npm
npm config set prefix "C:\Users\YOURNAME\AppData\Local\npm"
npm config set cache "C:\Users\YOURNAME\AppData\Local\npm-cache"
Add the new npm path to your environment's PATH.
setx PATH "%PATH%;C:\Users\YOURNAME\AppData\Local\npm"
For beginners, some of the npm modules I've made the most use of are as follows.
axios - for more complex http posts/gets
isomorphic-fetch - for http(s) post/get requests
node-mailer - smtp client
mssql - interface and driver library for querying MS SQL Server (wraps tedious)
More advanced JS options...
async/await - async functions, supported via babel
For testing, I reach for the following tools...
mocha - testing framework
chai - assertion library, I like chai.expect
sinon - spies and stubs and shims
sinon-chai - extend chai with sinon's assertion tools
babel-istanbul - coverage reports
jest - parallel testing, assertions, mocking, coverage reports in one tool
babel-plugin-rewire - slightly easier for some mocking conditions vs. jest
Web tooling.
webpack - module bundler, package node-style modules for browser usage
babel - convert modern JS (ES2015+) syntax for your deployment environment.
If you build it...
shelljs - shell utilities for node scripts,. I used to use gulp/grunt, but these days will have a scripts directory that's referenced in package.json scripts via npm. You can use gulp tools inside plain scripts.
When Node.js is not installed using the msi installer, npm needs to be setup manually.
setting up npm
First, let's say we have the node.exe file located in the folder c:\nodejs. Now to setup npm-
Download the latest npm release from GitHub (https://github.com/npm/npm/releases)
Create folders c:\nodejs\node_modules and c:\nodejs\node_modules\npm
Unzip the downloaded zip file in c:\nodejs\node_modules\npm folder
Copy npm and npm.cmd files from c:\nodejs\node_modules\npm\bin to c:\nodejs folder
In order to test npm, open cmd.exe change working directory to c:\nodejs and type npm --version. You will see the version of npm if it is setup correctly.
Once setup is done, it can be used to install/uninstall packages locally or globally. For more information on using npm visit https://docs.npmjs.com/.
As the final step you can add node's folder path c:\nodejs to the path environment variable so that you don't have to specify full path when running node.exe and npm at command prompt.
npm can be downloaded (without installation) from here:
http://nodejs.org/dist/npm/
https://github.com/npm/npm/releases
I just installed latest version of node (0.6.12) in Windows 7 using msi (node-v0.6.12.msi).
npm is already shipped with it, no need to include it separately.
I was facing permission issue while running npm (npm install mysql), from the path where my nodejs resided, i.e.
C:\Program Files (x86)\nodejs
Then I followed below steps:
1) Added C:\Program Files (x86)\nodejs\npm in environment variables - Path system variable.
2) went back to only C:\ in command prompt and gave the command - npm install mysql - and voila! it worked..
Hope this helps.
I am running node.js on Windows with npm.
The trick is simply use cygwin. I followed the howto under https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows) . But make sure that you use version 0.4.11 of nodejs or npm will fail!
I've just installed 64 bit Node.js v0.12.0 for Windows 8.1 from here.
It's about 8MB and since it's an MSI you just double click to launch. It will automatically set up your environment paths etc.
Then to get the command line it's just [Win-Key]+[S] for search and then enter "node.js" as your search phrase.
Choose the Node.js Command Prompt entry NOT the Node.js entry.
Both will given you a command prompt but only the former will actually work. npm is built into that download so then just npm -whatever at prompt.
Use a Windows Package manager like chocolatey. First install chocolatey as indicated on it's homepage. That should be a breeze
Then, to install Node JS (Install), run the following command from the command line or from PowerShell:
C:> cinst nodejs.install
Here is a guide by #CTS_AE on how to use NPM with standalone node.exe:
https://stackoverflow.com/a/31148216/228508
Download the node.exe stand-alone from nodejs.org
Grab an NPM release zip off of github https://github.com/npm/npm/releases
Create a folder named: node_modules in the same folder as node.exe
Extract the NPM zip into the node_modules folder
Rename the extracted npm folder to npm and remove any versioning ie: npm-3.3.4 –> npm.
Copy npm.cmd out of the /npm/bin/ folder into the root folder with node.exe
I just installed Node.js for the first time and it includes NPM, which can be ran from the Windows cmd. However, make sure that you run it as an administrator. Right click on cmd and choose "run as administrator". This allowed me to call npm commands.
Search all .npmrc file in your system.
Please verify that the path you have given is correct. If not please remove the incorrect path.

Resources