npm-install

npm install the exact package version specified in package.json

那年仲夏 提交于 2019-11-29 02:53:35
Currently, If I run npm install , it installs the updated version of already installed packages. How can I install the exact version as specified in the package.json file? That behavior is really driven by the one specifying the versions in the package.json. If the version number looks like "1.0.0", without any other symbols, the exact version (1.0.0) should be installed. So what you could do is simply modify the package.json and run a npm install then. Be sure to clear out the node_modules directory before you do that. https://docs.npmjs.com/files/package.json#dependencies Dale Jefferson By

Why wouldn't I use npm to install yarn?

北城余情 提交于 2019-11-28 18:18:56
问题 In the blog post announcing yarn (an alternative npm client) they say, "The easiest way to get started is to run npm install -g yarn ". But if you go to the "install yarn" page in their docs, "npm install yarn" isn't listed on any of the platform-specific installation pages, and it's only offered as the third of three options on the "Alternatives" page. Furthermore when you npm install yarn it prints a deprecation warning, "It is recommended to install Yarn using the native installation

How to solve npm install throwing fsevents warning on non-MAC OS?

与世无争的帅哥 提交于 2019-11-28 16:59:00
问题 Following warning is being thrown on npm install command - npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\rea ct-scripts\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@ 1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} ) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ch okidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY:

How do I deal with installing peer dependencies in Angular CLI?

旧时模样 提交于 2019-11-28 16:36:14
问题 I've found myself in an almost endless cycle of errors when trying to update my Angular CLI and NPM. Every time I update, I am met with WARN messages telling me to install peer dependencies (see below), but each time I install a dependency, I am met with more WARN messages. Is there a better way of handling this situation or does it seriously take hours? npm WARN @angular/animations@5.2.1 requires a peer of @angular/core@5.2.1 but none is installed. You must install peer dependencies yourself

What is the difference between npm install and npm run build?

跟風遠走 提交于 2019-11-28 16:18:32
问题 What is the difference between npm install and npm run build ? I have noticed in my project that sometimes npm starts failing when npm install is performed, but, upon running npm run build , it works just fine. How does the inner workings of these two targets namely install and run build differ? 回答1: npm install installs dependencies into the node_modules/ directory, for the node project you're working on. You can call install on another node.js project (module), to install it as a dependency

How to fix 'fs: re-evaluating native module sources is not supported' - graceful-fs

﹥>﹥吖頭↗ 提交于 2019-11-28 15:50:01
Recently I've made a switch to Node v.6, and It started creating more and more problems with running normal builds grunt/gulp/webpack For example: $ gulp [14:02:20] Local gulp not found in ~/_Other/angular-2-ts/angular2-seed [14:02:20] Try running: npm install gulp while gulp and all other plugins and modules are installed (and even re-installed via rm -rf node_modules ) in /node_modules folder. Most of those errors have line like (node:42) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. with 42 as

What is the difference between “npm install” and “npm ci”?

折月煮酒 提交于 2019-11-28 13:43:08
问题 I'm working with continuous integration and discovered the npm ci command. I can't figure what the advantages are of using this command for my workflow. Is it faster? Does it make the test harder, okay, and after? 回答1: From the npm docs: In short, the main differences between using npm install and npm ci are: The project must have an existing package-lock.json or npm-shrinkwrap.json. If dependencies in the package lock do not match those in package.json, npm ci will exit with an error,

npm install - javascript heap out of memory

怎甘沉沦 提交于 2019-11-28 09:44:40
When running npm install -g ionic I get the following error: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory Is there a way to globally increase the node.js memory limit? You can launch NPM using : node --max_old_space_size=8000 $(which npm) install -g ionic As described here , the default is 4000 (4Gb). I flagged this as a duplicate, but in case anyone happens across it, I posted the modern solution to this problem over at https://stackoverflow.com/a/48895989/4200039 : As of v8.0 shipped August 2017, the NODE_OPTIONS environment variable exposes this

base 64 encode and decode a string in angular (2+)

北慕城南 提交于 2019-11-28 06:41:10
How to encode or decode a string in angular 2 with base64 ??? My front-end tool is Angular 2. I had a password string, before passing it to API I need to base64 encode. Since in service base64 encoded string will be decoded. So I am looking for some base64 encode/decode library for Angular2/Typescript and some options. Thanks!!! Use the btoa() function to encode: console.log(btoa("password")); // cGFzc3dvcmQ= To decode, you can use the atob() function: console.log(atob("cGFzc3dvcmQ=")); // password Use btoa("yourstring") more info: https://developer.mozilla.org/en/docs/Web/API/WindowBase64

Install specific branch from github using Npm

大兔子大兔子 提交于 2019-11-28 05:09:20
I would like to install bootstrap-loader from github in my project using npm Currently they are maintaining two version of this project which are comaptible with webpack version 1 and 2. I would like to install version 1 . What npm command I should use to install this? I tried using below one but it is not working. npm install git://github.com/shakacode/bootstrap-loader.git[#v1] --Save There are extra square brackets in the command you tried. To install the latest version from the v1 branch, you can use: npm install git://github.com/shakacode/bootstrap-loader.git#v1 --save Just do: npm install