npm

npm install only if package missing or out-of-date compared to package.json

喜你入骨 提交于 2021-02-20 10:15:59
问题 I want to be able to compare my locally installed packages against my project package.json file without making a call against the npm online repo. If there is a package that is out of date based on the package.json file, then and only then will it go to the npm online repo and install the package. The reason for this is that I want to be able to update the package.json file to require a newer version of a package, commit this change to the project repo and when other developers on the team

npm install only if package missing or out-of-date compared to package.json

廉价感情. 提交于 2021-02-20 10:15:54
问题 I want to be able to compare my locally installed packages against my project package.json file without making a call against the npm online repo. If there is a package that is out of date based on the package.json file, then and only then will it go to the npm online repo and install the package. The reason for this is that I want to be able to update the package.json file to require a newer version of a package, commit this change to the project repo and when other developers on the team

npm install only if package missing or out-of-date compared to package.json

℡╲_俬逩灬. 提交于 2021-02-20 10:15:21
问题 I want to be able to compare my locally installed packages against my project package.json file without making a call against the npm online repo. If there is a package that is out of date based on the package.json file, then and only then will it go to the npm online repo and install the package. The reason for this is that I want to be able to update the package.json file to require a newer version of a package, commit this change to the project repo and when other developers on the team

(2/24) 快速上手一个webpack的demo

喜欢而已 提交于 2021-02-20 07:36:26
写在前面:该部分的安装都是基于windows系统的,且此处的webpack的版本为:3.6.0。 1.安装webpack 1.1 安装方法: 用win+R打开运行对话框,输入cmd进入命令行模式。然后找到你想开始项目的地方,输入下方代码: mkdir webpack3 cd webpack3 第一句是建立一个文件夹,第二句是进入这个文件夹。这个文件夹就是我们的项目文件目录了,文件夹建立好后,可以通过下面命令安装webpack。 需要注意的是,你在执行下一步时必须安装node,可以通过 node -v来查看node安装情况和版本,如果没有安装,要先安装node才可以继续进行。 戳此查看安装node.js 1.1.1 全局安装 // 全局安装---主要命令行需要直接输入webpack命令 npm install -g webpack 如果你这时安装失败了(出现了报错信息),一般有三种可能: 检查你node的版本号,如果版本号过低,升级为最新版本。 网络问题,可以考虑使用cnpm来安装(这个是淘宝实时更新的镜像),具体可以登录cnpm的官方网站学习 http://npm.taobao.org/。 权限问题,在Liux、Mac安装是需要权限,如果你是Windows系统,主要要使用以管理员方式安装。 解决方法: windows 使用win+x,选择命令提示符(管理员),在里面运行命令就好了。

vue首屏优化方案

坚强是说给别人听的谎言 提交于 2021-02-20 01:12:13
前言:最近用vue-cli 3.0 构建一个小型的工单管理系统,完工后build发现一个chunk-vendors包就达到985kb,加上其他一些资源文件,首页的下载总共大小快要2M。测试给的第一个反馈就是首屏慢慢慢慢慢! 根据首屏加载资源文件过大,进行一下优化: 1. 路由懒加载 结合Vue的异步组件再结合webpack的代码分割,我们可以轻松的实现路由懒加载。 ️vue-cli 3.0 模式就使用了Babel,我们需要添加 syntax-dynamic-import 插件,才能使 Babel 可以正确地解析语法。 // 安装插件 syntax-dynamic-import cnpm install --save-dev @babel/plugin-syntax-dynamic-import // 修改babel.config.js module.exports = { "presets": [ "@vue/app" ], "plugins": [ [ "component", { "libraryName": "element-ui", "styleLibraryName": "theme-chalk" }, "syntax-dynamic-import" ] ] } // 修改路由组件的加载(router/index.js) { path: '/', name: 'home'

Error for angular ui-router transition superseded / transition prevented / transition aborted / transition failed

∥☆過路亽.° 提交于 2021-02-19 05:42:05
问题 Im getting the errors: Error: transition superseded at $StateProvider.$get (http://localhost:1337/angular-ui-router/release/angular-ui-router.js:2903:42) Error: transition prevented Error: transition aborted Error: transition failed I found a similar post where he suggested solution is to update angular-ui-router to 0.3.1 however when I update it, it is being updated only to version 0.2.18, i checked the documentation which speaks about 0.2.18 as well so Im a little confused. I couldnt find

typescript automatically creating js files after running npm start

╄→尐↘猪︶ㄣ 提交于 2021-02-19 05:35:09
问题 I'm creating an Angular2 app using typescript, and every time I run npm start, all of my .ts files are compiled into javascript files and put in the directory. Is there anyway to turn this off. package.json { "name": "angular-prac", "version": "1.0.0", "scripts": { "start": "concurrent \"npm run tsc:w\" \"npm run lite\" ", "tsc": "tsc", "tsc:w": "tsc -w", "lite": "lite-server", "typings": "typings", "postinstall": "typings install" }, "license": "ISC", "dependencies": { "angular2": "2.0.0

events.js:167 throw er; //Unhandled 'error' event

旧巷老猫 提交于 2021-02-19 03:20:55
问题 Error: ENOSPC: no space left on device, watch '/home/me/Desktop/Edu/Web/JS/React/weather_app/public' I have over 700gb free space on my HDD, so don't think it is related to the error. !After the error it became unavailable to run 'npm start' on any project present on my machine. Today I started work on my project that I left yesterday evening in a perfectly working state. I wanted to add redux to my React project. Steps I made were: Initializing a local git repository and commiting the key

events.js:167 throw er; //Unhandled 'error' event

冷暖自知 提交于 2021-02-19 03:20:31
问题 Error: ENOSPC: no space left on device, watch '/home/me/Desktop/Edu/Web/JS/React/weather_app/public' I have over 700gb free space on my HDD, so don't think it is related to the error. !After the error it became unavailable to run 'npm start' on any project present on my machine. Today I started work on my project that I left yesterday evening in a perfectly working state. I wanted to add redux to my React project. Steps I made were: Initializing a local git repository and commiting the key