npm i not installing updated/new dependencies - node.js

I have npm version 5.0.3 installed. When I run npm i it does not install updated dependencies.
For example if I first clone:
git clone git#github.com:superflycss/task-test.git
And then update the superfly-css-pli dependency to #superflycss/pli:^1.0.0 and then run npm i the new #superflycss/pli package is not installed. I have to install it manually by running npm i --save-dev #superflycss/pli. Thoughts?

Related

Forked repository package not installed with npm 5

Description: I have installed npm 5.4.2 and node 8.7.0
Issue : When I run npm install command, npm installs successfully, but forked repo package is not installed. Please help me.
It's worked fine with npm version 3.10.10

Local grunt installation gives error

npm install -g grunt-cli //done successfully
npm install grunt --save --only=dev
gives following error
(node:11000) 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.
npm WARN prefer global coffee-script#1.10.0 should be installed with -g
project#1.0.0 C:\Users\Live\Desktop\node grunt\final
`-- (empty)
npm WARN project#1.0.0 No repository field.
npm ERR! code 1
Tried uninstalling grunt-cli, cleaning npm cache, then re-installing, but still the problem persists.
Ok short recap:
When in doubt remove your node_modules and install all packages again using npm install
If that didn't work, try updating your npm by executing npm update -g npm and redo step 1.
If that didn't solve your problem, try upgrading to another NodeJS version using nvm or n.

Install node module from own gitlab server

I'd like to install node modules from our gitlab server. This is a link to a repository:
http://ABCD-GITLAB/myGroup/myNodeModule.git
According to the npm install guide the install command should be this:
gitlabUser: me
myProject: myNodeModule
npm install gitlab:mygitlabuser/myproject
I have no idea how to reference my
gitlab server url
group
project
account name
I tried some commands but all failed:
npm install gitlab:ABCD-GITLAB:me/myproject
npm install gitlab:ABCD-GITLAB:me/myproject.git
npm install gitlab:http://ABCD-GITLAB:me/myproject
npm install gitlab:http://ABCD-GITLAB:me/myproject.git
npm install gitlab:http://ABCD-GITLAB:me/myGroup/myproject
npm install gitlab:http://ABCD-GITLAB:me/myGroup/myproject.git
npm install gitlab:http://ABCD-GITLAB:me/myGroup/myproject.git
What is the correct way to reference a npm dependency, a clear structure would be great like
npm install gitlab:<serverUrl/>:<username/>/<groupname/>/<projectname/><gitsuffix>.git
I would try one of these:
npm install git+ssh://git#ABCD-GITLAB:myGroup/myNodeModule.git
npm install git+https://git#ABCD-GITLAB/myGroup/myNodeModule.git
npm install git://ABCD-GITLAB/myGroup/myNodeModule.git
You may need to change git to your username and you can add #v1.0.27 or something like that at the end for a specific version or tag:
npm install git://ABCD-GITLAB/myGroup/myNodeModule.git#v1.0.27
You can also install from a tarball:
npm install https://ABCD-GITLAB:myGroup/myNodeModule/repository/archive.tar.gz
You can add ?ref=master to the end of the tarball URL for the branch.

NPM: revert installed packages

I'm working in a Node.js application with npm and git. When I add new npm packages I use npm <package> --save and it is saved on 'package.json' file.
The thing is that when I use git reset --hard, the 'package.json' file is reverted, but the packages are still installed.
The question is: how can I uninstall automatically npm packages that I have installed before the git reset --hard?
After reverting, you can try npm prune option. This will unbuild all the packages not there in package.json
npm prune

How to npm install a module without installing peer dependencies

I am trying to npm install karma-jasmine and for some odd purpose only want to npm install that module and not karma. It install karma as well as it is defined as a peerDependency. Is it possible to not install peerDependency and how? I am using npm 1.4.28
This is my package.json
{"dependencies": {"karma-jasmine": "0.2.3"}}
Can you update to newer npm, let say version >=3 ? It does not install peerDependencies by default.

Resources