npm-install

Do I need both package-lock.json and package.json?

烈酒焚心 提交于 2019-11-28 04:15:55
After updating my NPM to the latest version (from 3.X to 5.2.0) and running npm install on an existing project, I get an auto-created package-lock.json file. I can tell package-lock.json gives me an exact dependency tree as opposed to package.json . From that info alone, it seems like package.json is redundant and not needed anymore. Are both of them necessary for NPM to work? Is it safe or possible to use only the package-lock.json file? The docs on package-lock.json ( doc1 , doc2 ) doesn't mention anything about that. Edit : After some more thinking about it, I came to the conclusion that if

Angular2 - Angular-CLI installing lodash - Cannot find module

回眸只為那壹抹淺笑 提交于 2019-11-28 03:16:02
问题 Mac OSX El capitan | angular-cli: 0.1.0 | node: 5.4.0 | os: darwin x64 I try to install a 3rd party npm module according to the angular-cli wiki: https://github.com/angular/angular-cli/wiki/3rd-party-libs but fail. I've been struggling with this for days now and would greatly appreciate any help. Steps to get the error: ng new lodashtest3 cd lodashtest3 npm install lodash --save typings install lodash --ambient --save angular-cli-build.json: module.exports = function(defaults) { return new

How to install grunt and how to build script with it

╄→尐↘猪︶ㄣ 提交于 2019-11-28 02:39:01
Hi I'm trying to install Grunt on Windows 7 64 bit. I have installed Grunt using commands npm install -g grunt npm install -g grunt-cli but now if I try to do grunt init , it is throwing me an error - A valid Gruntfile could not be found. Please see the getting started guide for more information on how to configure grunt: http://gruntjs.com/getting-started Fatal error: Unable to find Gruntfile. But when I look inside the grunt folder on my system the Gruntfile.js is there. can someone please guide me how to install this grunt properly and how to write built Script using the grunt. I have one

Installing npm package fails with 404

别来无恙 提交于 2019-11-28 01:53:52
Using the command prompt, I am trying to install angular CLI and it fails. I have npm version 5.5.1 and node version v8.9.1. I am trying to install angular cli using the command npm install -g @angular/cli@latest and it fails with the error: npm ERR! code E404 npm ERR! 404 Not Found: @angular/cli@latest npm ERR! A complete log of this run can be found in: I look at the log file and I see its trying to fetch the package from a location that doesn't exist. Not sure from where it gets pulled. How do I fix this location path and install angular cli. Same happens when I try to install typescript or

npm install error code EBUSY errono -4082

寵の児 提交于 2019-11-28 01:37:19
I am running windows7 and have just installed the following... c:\design_centre_dev\workspace>node -v v5.10.1 c:\design_centre_dev\workspace>npm -v 3.8.6 I'm having issues running npm install on my node project which one of my fellow dev's says he has no trouble with and should work for me. When I run npm install i am getting errors like... npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\rriviere\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" npm ERR! node v5.10.1 npm ERR! npm v3.8.6 npm ERR! path c:\design_centre_dev

BrowserSync : Command not found after installing browser-sync

天大地大妈咪最大 提交于 2019-11-28 00:44:23
问题 There was another issue open with the same title which has been closed but my error could not be resolved using the solutions given in that issue. Mac OSX El Capitan Node [v5.6.0] Npm [v3.6.0] I installed Browser-Sync successfully using : bash $ sudo npm install -g browser-sync but when I check the browser-sync version by typing : bash $ browser-sync --version I get this error : bash -bash: browser-sync: command not found 回答1: Check where npm installs it's binaries by running npm bin -g , and

NPM preinstall script

a 夏天 提交于 2019-11-28 00:31:06
问题 I am trying to run some policing script before any packages are installed. For Example: { "name": "pre-hook-check", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "preinstall": "echo preinstall", "postinstall": "echo postinstall" }, "author": "", "license": "ISC", "dependencies": { "abc": "^0.6.1", "preact": "^8.2.5" } } It seems the pre and post install script on above example only works when I do npm install ,

npm install the exact package version specified in package.json

ⅰ亾dé卋堺 提交于 2019-11-27 15:47:19
问题 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? 回答1: 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

How to npm install to only save dependency to package.json?

给你一囗甜甜゛ 提交于 2019-11-27 13:48:04
问题 I'm adding dependencies to a package.json that will be used as part of a provisioning process for a virtual machine. As such, I don't actually need to install the modules locally since the provisioner will do that for me inside the VM. So is there any way to do the following: npm install --save <module> So that it only creates a dependency for the latest version of the module in package.json without actually downloading the module or creating a node_modules folder? The --dry-run option is

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

百般思念 提交于 2019-11-27 09:36:28
问题 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