Installed typings globally
> npm install typings -g
Installed several typings
> typings install dt~angular --save --global
> typings install dt~angular-ui-router --save --global
> typings install dt~ui-grid --save --global
> typings install npm~lodash --save
All works fine, typings.json file is created together with typings folder. And when I run "typings install" from command line I get expected output
> typings install
├── lodash#4.0.0
├── angular (global)
├── angular-ui-router (global)
└── ui-grid (global)
Then I add npm script to automate a little bit project deployment
"scripts": {
"install": "typings install"
},
But when I try to run "npm install" only module typings are installed. Global typings are completely ignored
> typings install
└── lodash#4.0.0
Tried to add --global flags into package.json but without success.
Most likely you have a LOCAL version of typings that is not 1.3.2
Run npm install -D typings#latest
Related
Is there any way to disable the command npm install or npm i on a project through the package.json config?
I'm using yarn to add and install npm dependencies, and I want to force to not use npm install
I need to install lodash.filter to my Expo (React Native) project.
How should I do it using npm?
1.
npm i -g npm
npm i --save lodash.filter
npm i --save lodash.filter
I do not understand what npm i -g npm (it's updating something, but I think it will destroy my project).
$ npm i -g npm
$ npm i --save lodash
you can use second command.
npm i is the alias for the npm install and -g means gloabal
The -g or --global argument will cause npm to install the package globally rather than locally
npm install (in package directory, no arguments):
Install the dependencies in the local node_modules folder.
Just follow the command that are written in documentation it will be fine
The --save option instructed NPM to include the package inside of the dependencies section of your package.json automatically, thus saving you an additional step.
What is the difference between npm -g(global) install and npm --save?
First gulp install -g and --save first, then for other projects:
npm i gulp --save-dev Can I just use this command?
I don't know the basic difference between them?
npm -g will install packages globally (to npm cached folder), normally in AppData\Roaming\npm\node_modules if you're using Windows, while npm --save or --save-dev will install package directly to your node_modules directory in your project and add package to your packages.json for later purpose.
So basically I want to understand why when I run npm install sass-loader node-sass --save-dev I get this error
├── UNMET PEER DEPENDENCY generator-karma#>=0.9.0
However it's clear that Karma is installed since when I run npm install generator-karma I see that :
└─┬ generator-karma#2.0.0 <--- Which mean karma is there...
└─┬ yeoman-generator#0.22.6
├── async#1.5.2
...
I've read answer explaining I should use npm install -g grunt-cli bower yo generator-karma generator-angular but this is not helping much.
Should I uninstall and reinstall a clean node_modules ?
npm no longer installs module dependencies automatically. That means you have to install the dependencies modules yourself. Basically if you run npm install generator-karma#>=0.9.0 and then run the your previous npm install command you should be good to go.
I want npm install to install the bower dependencies as well. I have a bower.json file containing frontend packages and there is package.json file which contains the backend packages. After i run npm install, node_modules are installed whereas the dependencies mentioned in bower.json file are not installed.
I don't want to use bower install rather I want to do all this with npm install command.
It's quite simple. If you have bower listed in package.json as dependency you may add postinstall script to your package.json as follows:
"scripts": {
"postinstall": "bower install"
}
and running npm install will launch also bower install automatically