npm笔记

npm config set cache "D:\nodejs\node_cache" //设置缓存文件夹
npm config set prefix "D:\nodejs\node_global" //设置全局模块存放路径

npm install -g cnpm --registry=https://registry.npm.taobao.org

npm install yarn -g

yarn config set global-folder "路径"
yarn config set cache-folder "路径"

npm install webpack -g
npm install vue -g
npm install @vue/cli –g

vue init webpack 项目名
在项目目录下
npm install axios -s
npm run dev

 

 

加入如下代码
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS;
#支持put和delete请求
return 200;
}

在Nginx中这样配置
location /xxx {
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS;
return 200;
}
proxy_pass http://xxx/xx;
}

posted @   wujf  阅读(12)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
点击右上角即可分享
微信分享提示