NPM
- List globally installed packages + versions:
npm list -g --depth=0 - Update npm:
npm install -g npm - Install specific version of npm (works with NVM):
npm install -g npm@1.4.3 - Install local module:
npm install /path- Beware, the command will COPY the content of the target repo found in
/pathinto your project'snode_modules, no further changes in/pathwill be reflected in the local repo unless you donpm install /pathagain. I'd recommend to usenpm linkfor module development.
- Beware, the command will COPY the content of the target repo found in
- Execute commands for a package in a subdirectory:
- Install:
npm --prefix ./path/to/package install ./path/to/package - Test:
npm --prefix ./path/to/package test
- Install:
package.jsondependency notation (https://stackoverflow.com/questions/22343224/whats-the-difference-between-tilde-and-caret-in-package-json):^or1.x.x: is 1.[any].[any] (latest minor version)~or1.2.x: is 1.2.[any] (latest patch)
- Error: "ENOENT: no such file or directory, uv_cwd"
- Weird shell/dir issue, restart shell(s)
- https://github.com/nodejs/node/issues/1184
- https://github.com/foreverjs/forever/issues/200
Published