npm install vs. update – what’s the difference?

The difference between npm install and npm update handling of package versions specified in package.json: { “name”: “my-project”, “version”: “1.0”, // install update “dependencies”: { // —————— “already-installed-versionless-module”: “*”, // ignores “1.0” -> “1.1” “already-installed-semver-module”: “^1.4.3” // ignores “1.4.3” -> “1.5.2” “already-installed-versioned-module”: “3.4.1” // ignores ignores “not-yet-installed-versionless-module”: “*”, // installs installs “not-yet-installed-semver-module”: “^4.2.1” // installs … Read more

Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’

Change your file permissions… Like this First check who owns the directory ls -la /usr/local/lib/node_modules it is denying access because the node_module folder is owned by root drwxr-xr-x 3 root wheel 102 Jun 24 23:24 node_modules so this needs to be changed by changing root to your user but first run command below to check … Read more

How to specify a port to run a create-react-app based project?

If you don’t want to set the environment variable, another option is to modify the scripts part of package.json from: “start”: “react-scripts start” to Linux (tested on Ubuntu 14.04/16.04) and MacOS (tested by aswin-s on MacOS Sierra 10.12.4): “start”: “PORT=3006 react-scripts start” or (may be) more general solution by IsaacPak “start”: “export PORT=3006 react-scripts start” … Read more

Local dependency in package.json

npm >= 2.0.0 This feature was implemented in the version 2.0.0 of npm. Local paths can be saved using npm install -S or npm install –save, using any of these forms: ../foo/bar ~/foo/bar ./foo/bar /foo/bar Example package.json: { “name”: “baz”, “dependencies”: { “bar”: “file:../foo/bar” } } npm ls: app@0.0.1 /private/tmp/app └── somelocallib@0.0.1 -> /private/tmp/somelocallib npm … Read more

How to use executables from a package installed locally in node_modules?

UPDATE: As Seyeong Jeong points out in their answer below, since npm 5.2.0 you can use npx [command], which is more convenient. OLD ANSWER for versions before 5.2.0: The problem with putting ./node_modules/.bin into your PATH is that it only works when your current working directory is the root of your project directory structure (i.e. … Read more

Node Sass couldn’t find a binding for your current environment

I had the same problem There is an error in your gulpfile: Error: Missing binding E:\allapp\badshaindiancuisine\node_module\node-sass\vendor\win32-x64-46\binding.node Node Sass could not find a binding for your current environment:Windows 64-bit with Node.js 4.x Found bindings for the following environment:     – OS X 64-bit with Node.js 4.x How to solve the problem By going into the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)