Jump to content


Open .npmrc file in visual studio code

Recommended Posts

In a Vim editor  I can open the .npmrc file with this command:

myproject $ vim ~/.npmrc   <ENTER>


How do I do this in Visual Studio Code ?

1) myproject $ vscode ~/.mpmrc <ENTER> or . . .


2) myproject $ npm set editor code

    myproject $ npm config edit



Link to comment
Share on other sites

I also never use commands to open files. I open them manually.

'myproject > npm set editor code' followed by

'myproject > npm config edit' did NOT work for me.


1) There is a npmrc file in C:\Users\SteinarV\AppData\Roaming\npm\node_modules\npm\npmrc.

Maybe I can open that file manually, and paste in these lines:

'//npm.greensock.com/:_authToken=<my auth token>

But I can NOT open this npmrc file with the 'Visual Studio Code' editor.


2) Or maybe I can create a .npmrc file manually in my project root folder, and paste in the above lines ?


3) Then the first time that I install GSAP to a project I need to install via: npm install gsap@npm:@gsap/shockingly

Link to comment
Share on other sites

6 hours ago, SteinarvDesign said:

But I can NOT open this npmrc file with the 'Visual Studio Code' editor.


I'm on Windows too, but I've never had that problem. When I installed VS Code, I set the option to add it context menu so I can right click on a file to open it.






But I rarely do that. I usually just create and edit the file within my project folder...




If you still can't get it working, you should probably direct your problem to the VS Code team as they would be more knowledgeable on the subject.


  • Like 1
Link to comment
Share on other sites

GSAP with html, css, js, CDN files and a 'scripts' folder for the bonus plugins is the best solution so far.


A project with a bundler - Webpack or Parcel - is more problematic because of the large number of dependencies the bundler relies on. Creating a .npmrc file within my project folder and installing via: 'npm install gsap@npm:@gsap/shockingly' is working, but
several security vulnerabilities not related to GSAP is a problem.


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.