简体   繁体   中英

how to setup npm environment variables in windows

i have a Windows machine. i need to setup the npm private profile to accept private packages for my code. my dev team has provided only a hexadecimal token for the setup. The npm documentation describes to use the token like this export NPM_TOKEN="00000000-0000-0000-0000-000000000000". but windows machine is not accepting this command.

can anyone help me on setting the npm token in a windows 10 laptop.

You can do this:

  • In cortana search bar: Start typing something like variables or environment var and click on the Edit environment variables for your account entry
  • In the opened window click on New... button in User variables section.
  • Variable name: NPM_TOKEN
  • Variable value: 00000000-0000-0000-0000-000000000000 (use your own token)
  • Save and restart computer

It should be done

Another method

In PowerShell, you can set environment variable by $env:path=value . This will be applicable only to that Powershell session only.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM