当前位置:网站首页>Node environment configuration
Node environment configuration
2022-06-30 10:17:00 【Adair_ Xu】
There are two main changes :( Assume node The installation directory is D:\nodejs)
1. Global module download installation directory :
npm config set prefix “D:\nodejs\node_global”
npm config set cache “D:\nodejs\node_cache”
After modification , The downloaded module is automatically installed in D:\nodejs\node_global Under the node_modules In the catalogue
2. Modify environment variables
2.1) In user variables , find path, Delete npm Environment variable value at the end ( There are plenty of them npm/node_modules ending ), add value :D:\nodejs\node_global
2.2) In user variables , newly added NODE_PATH Variable , The value is :D:\nodejs\node_global\node_modules
After modification ,node Can be loaded into the downloaded module
The above two steps , Especially the environment variables NODE_PATH Value , Finally, I want to write node_modules Catalog , otherwise , The corresponding package will not be loaded . You can enter commands npm install -g vue install vue modular , Then type the command node, And then you type in require('vue'), Return module information , Load succeeded , To configure ok; Or write a js Scripts like test.js, Content such as : var vue = require('vue');console.info(vue); And then in cmd perform node test.js, Return module information , Load succeeded , To configure ok
3. Switch the mirror address ( Optional )
download nrm package :npm install -g nrm
Switch the image address to Taobao npm Mirror address :nrm use taobao
边栏推荐
- 事件委托的使用与说明》
- 【C语言快速上手】带你了解C语言,零基础入门③
- 100个句子记完7000个雅思词汇,实际只有1043个词汇(包括 I and you 等简单词汇)
- Force buckle 428 Serialize and deserialize n-tree DFS
- Right click to open CMD (command line)
- 6.Redis新数据类型
- Didn't receive robot state (joint angles) with recent timestamp within 1 seconds
- 2021-07-26
- [AGC] build service 3- authentication service example
- 2022第六季完美童模 托克逊赛区 决赛圆满落幕
猜你喜欢

Flume learning II - Cases

【JVM】G1垃圾回收器简述

unable to convert expression into double array

Applying applet container technology to IOT ecological construction
![[AGC] build service 3- authentication service example](/img/32/44547c00476a055557dd1790e18849.png)
[AGC] build service 3- authentication service example

【JVM】CMS简述

The famous painter shiguoliang's "harvest season" digital collection was launched on the Great Wall Digital Art

机械臂速成小指南(四):机械臂关键部件之减速机

MIT-6874-Deep Learning in the Life Sciences Week6

7.手机登陆功能开发
随机推荐
Appium自动化测试基础 — adb shell 命令
OSError: [Errno 28] No space left on device
【C语言快速上手】带你了解C语言,零基础入门③
浏览器复制的网址粘贴到文档是超链接
[JVM] G1 garbage collector
MySQL index, transaction and storage engine of database (3)
Chen Haotian won the national championship of the national finals of the 7th children's model star ceremony
G code explanation | list of the most important G code commands
Applying applet container technology to IOT ecological construction
2022 Season 6 perfect children's model toxon division finals came to a successful conclusion
7. development of mobile login function
MIT-6874-Deep Learning in the Life Sciences Week4
“昆明城市咖啡地圖”活動再度開啟
Regular expression Basics
[JVM] brief introduction to CMS
MIT-6874-Deep Learning in the Life Sciences Week6
2022第六季完美童模 托克逊赛区 决赛圆满落幕
Launch of Rural Revitalization public welfare fund and release of public welfare bank for intangible cultural heritage protection of ancient tea tree
C語言實現掃雷遊戲,附詳解及完整代碼
Right click to open CMD (command line)