npm-install

Two versions of same npm package in Node application

北城以北 提交于 2019-12-03 04:50:19
问题 I'm working on a CLI tool in NodeJS that uses another NodeJs package that we develop, which is an SDK. The thing is, we just published a V2 version of that SDK, and we want to offer the CLI user a legacy mode, so they can use either the first or second version of our SDK, like so: $ cli do-stuff #execute sdk v2 Or $ LEGACY_MODE='on' cli do-stuff #execute sdk v1 My problem is that I did not found any clean way to use two versions of the same dependency in my CLI. I tried to use npm-install

How to install only “devDependencies” using npm

荒凉一梦 提交于 2019-12-03 04:28:37
问题 I am trying to install ONLY the "devDependencies" listed in my package.json file. But none of the following commands work as I expect. All of the following commands install the production dependencies also which I do not want. npm install --dev npm install --only=dev npm install --only-dev I cannot think of any more ways of telling the npm to install the devDependencies alone. :( 回答1: Check the NPM docs for install: With the --production flag (or when the NODE_ENV environment variable is set

Why did package-lock.json change the integrity hash from sha1 to sha512?

£可爱£侵袭症+ 提交于 2019-12-03 04:07:59
I just generated a new npm lockfile, package-lock.json, as part of my typical workflow. But I noticed that this time all of the integrity hashes have been changed from sha1 to sha512. What is happening here? Dave From what I can see, npm changed the integrity checksum from sha1 to sha512. If your git changes are going from sha1 to sha512, you should do that update once and it will be good after that. If someone else working with the codebase and sees a git change from sha512 down to sha1 (which is the issue I was having) you can fix it by running the following: Discard the changes in git for

What do the --save flags do with npm install

家住魔仙堡 提交于 2019-12-03 04:02:19
问题 I see instructions to install a package with either npm install <package_name> or npm install <package_name> --save or npm install <package_name> --save-dev What is the difference between these options? 回答1: npm install takes 3 exclusive, optional flags which save or update the package version in your main package.json: -S, --save: Package will appear in your dependencies. -D, --save-dev: Package will appear in your devDependencies. -O, --save-optional: Package will appear in your

Local gulp not found (Try running: npm install gulp)

白昼怎懂夜的黑 提交于 2019-12-03 04:00:38
问题 I created a module ( webapp-module-storage ) which has the following definitions: package.json { "dependencies": { ... }, "devDependencies": { "gulp": "^3.9.1", ... }, "name": "webapp-module-storage", "scripts": { "postinstall": "gulp build", "test": "gulp test" } } I thought I can use my module inside another module when installing it with: npm install github:myorg/webapp-module-storage#master However, when I install my module, I am getting this error: Local gulp not found Try running: npm

npm install error - unable to get local issuer certificate

不想你离开。 提交于 2019-12-03 03:05:09
问题 I am getting an unable to get local issuer certificate error when performing an npm install: typings ERR! message Unable to read typings for "es6-shim". You should check the entry paths in "es6-shim.d.ts" are up to date typings ERR! caused by Unable to connect to "https://raw.githubusercontent.com/D efinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/es6-shim /es6-shim.d.ts" typings ERR! caused by unable to get local issuer certificate I have recently update to node 4 from

Using “npm install” to install jquery-ui

倖福魔咒の 提交于 2019-12-03 02:02:31
I see from here https://github.com/jquery/jquery-ui that jquery-ui's latest release is 1.11.4. However, when I use "npm install jquery-ui", it's only 1.10.3. I checked this version in node_modules/jquery-ui/jquery-ui.js . Is there any way for me to install the latest version? jQuery-ui specifically needs to be build after installation. To avoid this, use npm install jquery-ui-dist T J gave the right answer, but it is a bit short / too generic... The GitHub project is at https://github.com/jquery/jquery-ui/ So the real command would be npm install github:jquery/jquery-ui (you can even skip

How Does One Include Bootstrap in Node Project

馋奶兔 提交于 2019-12-02 22:09:12
I have a MEAN stack project that was scaffolded using the basic npm command. At the moment, the Bootstrap is included using CDN: link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css') My question is how can I add bootstrap using npm so the project works same as with CDN inclusion. In particular, when I run npm install bootstrap a boostrap directory is created within node_modules. However, if I try to include the bootstrap.css from that directory, it breaks the glyphicon fonts. Could anyone advise on how to do it? P.S. I would also pose the same

Laravel Homestead, npm install --no-bin-links error

我们两清 提交于 2019-12-02 22:03:12
问题 I am using fresh Homestead (box version 0.5) for a fresh Laravel 5.3 app. Host OS is Windows 10. I get this error when running npm install --no-bin-links npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to

npm gets stuck on fetchMetadata -> network

∥☆過路亽.° 提交于 2019-12-02 19:56:10
My npm is getting stuck a lot, whether its npm install from package.json or individual packages. Right now, I'm not even able to sudo npm install node-inspector -g I'm using node 6.2.1 , npm 3.9.5 on ubuntu 16.04 npm cache clear didnt help. The installation takes hours or fails. Check if there any issues with proxies if you using any. You can try also to set npm's endpoint manually: npm config set registry="http://registry.npmjs.org" try yarn installer instead of npm: sudo npm install -g yarn yarn install I found it much more resilient to such problems. I had this same problem, with several