I have this problem with Visual Studio Code for Windows 10: I can't see anymore the NPM scripts in explorer sidebar.
I deleted all the extensions, uninstalled VS Code cancelling also its folder and the extension folders, installed latest version of VS Code again with no custom options and no extensions, but it didn't solved my problem; the NPM scripts menu does not appear.
How could I fix this so that the NPM Scripts menu option is shown again?
Listing the scripts available in a package. json file is easy: just go to the root directory of your project and type npm run in the terminal. Then run the ntl command in the project folder. You'll get a list of available scripts, with the option of selecting one of them to run.
Using the NPM (Node Package Manager) scripts is also simple. To define an NPM script, set its name and write the script under the 'scripts' property of your package. json file: To execute your Script, use the 'npm run <NAME-OF-YOUR-SCRIPT>' command.
You can easily run scripts using npm by adding them to the "scripts" field in package. json and run them with npm run <script-name> . Run npm run to see available scripts. Binaries of locally install packages are made available in the PATH , so you can run them by name instead of pointing to node_modules/.
If you're calling npm from the VSCode terminal, you need to restart VSCode first before trying again. If you still get the error, then try restarting your computer first. The error should be gone after you restart. Now you should be able to install any npm package to your local computer with npm install command.
Few places to look for the NPM-Scripts explorer :
The npm-scripts explorer can be enabled or disabled with the below settings, in VSCode's settings.json
:
"npm.enableScriptExplorer": false
Default value is false
, change to true
and it should work. Try restarting VSCode for changes to take effect(although a restart is not often required) if it doesn't show up.
Another very hard to notice place is the three dots ...
in the top right corner of your project explorer (verify if NPM scripts is checked). This is something which I had experienced personally for a different extension.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With