npm

Install devDependencies on Heroku

放肆的年华 提交于 2020-11-25 06:08:42
问题 I would like to have Heroku build my app after I push it so that I don't have to push the build folder up every time I make a change. However heroku only installs the dependencies from the package.json and grunt (my build tool) and all of its components are in devDependencies. I would like to keep them there where they belong. What's the workaround here? 回答1: Heroku by default installs only the production dependencies, ignoring the development dependencies under devDependencies . Setting the

package.json 笔记

夙愿已清 提交于 2020-11-25 06:07:48
package.json 1、概述: 每个项目的根目录下面,一般都有一个 package.json 文件,定义了这个项目所需要的各种模块,以及项目的配置信息(比如 名称、版本、许可证等元数据 )。 npm install 命令根据这个配置文件,自动下载所需的模块,也就是配置项目所需的运行和开发环境。 package.json :>>>内部是json对象 { "name " : "xxx ", //name就是项目名称 "version " : "0.0.0 ", //version是版本(遵守“大版本.次要版本.小版本”的格式)。 } 完整的package.json { "name ": "Hello World ", "version ": "0.0.1 ", "author ": "张三 ", "description ": "第一个node.js程序 ", "keywords ":[ "node.js ", "javascript "], "repository ": { "type ": "git ", "url ": "https://path/to/url " }, "license ": "MIT ", "engines ": { "node ": "0.10.x "}, "bugs ":{ "url ": "http://path/to/bug ", "email

package.json 知多少?

梦想的初衷 提交于 2020-11-25 06:07:25
在 Node.js 中,模块是一个库或框架,也是一个 Node.js 项目。 Node.js 项目遵循模块化的架构,当我们创建了一个 Node.js 项目,意味着创建了一个模块,这个模块必须有一个描述文件,即 package.json 。它是我们最常见的配置文件,但是它里面的配置你真的有详细了解过吗?配置一个合理的 package.json 文件直接决定着我们项目的质量,本章就带大家了解下 package.json 的各项详细配置。 必备属性 package.json 中有非常多的属性,其中必须填写的只有两个: name 和 version ,这两个属性组成一个 npm 模块的唯一标识。 其中版本我们在上一章节已经介绍过了,有兴趣的可以查看 前端工程化(一)NPM如何管理依赖包版本? npm包命名规则 name 即模块名称,其命名时需要遵循官方的一些规范和建议: 包名会成为模块 url 、命令行中的一个参数或者一个文件夹名称,任何非 url 安全的字符在包名中都不能使用,可以使用 validate-npm-package-name 包来检测包名是否合法。 语义化包名,可以帮助开发者更快的找到需要的包,并且避免意外获取错误的包。 若包名称中存在一些符号,将符号去除后不得与现有包名重复 例如:由于 react-native 已经存在, react.native 、

package.json和模块查找规则

杀马特。学长 韩版系。学妹 提交于 2020-11-25 05:48:16
2. package.json文件 视频: 22-package.json文件的作用(一) package.json : 项目(包)描述文件 # 初始化项目描述文件 npm init # 快速初始化项目描述文件 (里面的必填项都是默认值) npm init -y | --yes 主要配置项: package name: 项目名称(包名) version:版本号 description: 项目描述(包功能描述) main:入口文件 test command:命令行 git repositroy:git发布地址 keywords:项目关键词 author:作者 license:许可证号 (ISC) package.json 基本作用 package.json文件是项目描述文件,使用 npm init 来生成该文件 (npm init -y | --yes 能够快速生成该文件) 该文件中记录了项目的基本信息和项目所依赖的第三方包(也叫第三方模块、使用 npm i 下载的第三方模块都会记录在该文件中) 如果项目中没有 node_modules 目录,使用 npm i 一次性下载所有的第三方模块。 (npm 工具会根据package.json文件中的 dependencies 项去下载) 其他 第三方模块可以分为两类: 第一类:开发需要,项目完成上线运行之后依然需要的包 (jquery

以React框架及Antd组件开发前端项目

孤街醉人 提交于 2020-11-24 18:29:03
1、react项目构建使用脚手架:create-react-app 配置:antd UI框架配置和less配置 一、命令行依次输入如下的命令 npm install -g create-react-app create-react-app my-app cd my-app npm start npm install create-react-app yarn -g create-react-app your_project_name cd your_project_name yarn start yarn add antd --save ----安装antdesign 来源: oschina 链接: https://my.oschina.net/u/4672357/blog/4742207

Github actions, 401 unauthorized when installing a Github Package with npm or yarn

徘徊边缘 提交于 2020-11-24 16:29:09
问题 When I try to install my npm modules from a GitHub action I get the following error: npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/@xxxx%2fxxxx-analytics - Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured. Before you comment, I have configured the .npmrc correctly with the scope and access token, and everything works fine when installing the private package locally. Here is

Github actions, 401 unauthorized when installing a Github Package with npm or yarn

点点圈 提交于 2020-11-24 16:27:43
问题 When I try to install my npm modules from a GitHub action I get the following error: npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/@xxxx%2fxxxx-analytics - Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured. Before you comment, I have configured the .npmrc correctly with the scope and access token, and everything works fine when installing the private package locally. Here is

Github actions, 401 unauthorized when installing a Github Package with npm or yarn

吃可爱长大的小学妹 提交于 2020-11-24 16:22:25
问题 When I try to install my npm modules from a GitHub action I get the following error: npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/@xxxx%2fxxxx-analytics - Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured. Before you comment, I have configured the .npmrc correctly with the scope and access token, and everything works fine when installing the private package locally. Here is

appium+python自动化63-使用Uiautomator2报错问题解决

风格不统一 提交于 2020-11-24 13:25:12
前言 appium desktop V1.7.1版本使用命令行版本启动appium后,使用Uiautomator2定位toast信息报错:appium-uiautomator2-server-v0.3.0.apk does not exist or is not accessible 主要原因是缺少appium-uiautomator2-server-v0.3.0.apk这个apk文件 问题分析 打开cmd启动命令行版本,appium V1.7.1 使用Uiautomator2定位toast信息 from appium import webdriver desired_caps = { "platformName": "Android", "deviceName": "emulator-5554", # 设备名称 "platformVersion": "5.1.1", # android系统版本号 "appPackage": "com.yipiao", # app包名 "appActivity": "com.yipiao.activity.LaunchActivity", # 启动launch Activity "noReset": True, # 不清空数据 'automationName': 'Uiautomator2' # 使用Uiautomator2 } driver =

基于Visual Studio Code搭建Vue开发环境

落爺英雄遲暮 提交于 2020-11-24 06:56:28
安装node.js最新版 这里安装的是 8.11.4 版 image.png 更新npm至最新版 安装node.js后, npm默认版本为: 6.1.0 image.png 使用 npm install npm -g 更新npm至最新版 image.png 安装vs code 安装过程就忽略了. 安装@vue/cli > npm install -g @vue/cli image.png 创建一个vue-demo-project工程 创建过程中默认配置(开箱即用) image.png image.png 打开工程 image.png 默认情况下, VS code是使用英文的, 有需要的话, 大家也可自行修改为中文: 按下ctrl+p, 输入: > Config , 选择: “Configure Display Language" image.png 将原先的: image.png 修改为: image.png 修改并保存后, 会提示安装语言包, 安装即可: 打开一个 .vue 的文件时, 会提示推荐安装 vetur 插件, 当然选择安装了。安装成功后,会提示重启vscode image.png Vetur支持.vue文件的语法高亮显示,除了支持template模板以外,还支持大多数主流的前端开发脚本和插件,比如Sass和TypeScript等等 eslint