nvm install node fails to install on macOS Big Sur M1 Chip

If you have installed nvm using homebrew and are trying to install the node using command nvm install <some_version>, you will face errors on apple silicon machines (ARM) for versions lower than 15. Node versions older than 15 do not work on apple silicon machines (ARM) because ARM architecture is not supported. For anything under … Read more

How to have npm install a typescript dependency from a GitHub url?

I had the same problem. Saw a lot of articles about monorepos (links below), but not much about how to split a TypeScript project into separate repositories. In short, you need to build JS files at one step or the other. See https://github.com/stared/yarn-adding-pure-typescript-package-example for a working code example. So, there are a few solutions. Let’s … Read more

Golang equivalent of npm install -g

Update: If you’re using Go 1.16, this answer still works, but go install has changed and is now the recommended method for installing executable packages. See Karim’s answer for an explanation: https://stackoverflow.com/a/68559728/10490740 Using Go >= 1.11, if your current directory is within a module-based project, or you’ve set GO111MODULE=on in your environment, go get will … Read more

How to use npm modules in browser? is possible to use them even in local (PC)?

browserify is the correct direction, but it took me quite some effort to work out the actual solution. I have summarized a short blog for this, and here are some quick recap: Say, you want to use emailjs-mime-parser and buffer npm libraries in your HTML. install everything required npm install -g browserify npm install emailjs-mime-parser … Read more

Error: Cannot read property ‘replace’ of undefined when building iOS Cordova

New solution This issue is fixed in the latest version of the “ios-sim” package (so now this is probably the easier solution – compared to the old one which is listed below). In order to update the “ios-sim” package to the latest version run this in your terminal/cmd: cd platforms/ios/cordova/node_modules/ sudo npm install -g ios-sim@latest … Read more

How to npm install to only save dependency to package.json?

Was searching for the solution. Haven’t found, then made a script which adds dependencies (latest or specified versions) to the package.json file skipping the installation process. https://www.npmjs.com/package/add-dependencies Installation If not using with npx (see below): $ npm install add-dependencies [-g] Usage Run: $ add-dependencies [package_file] <dependencies> [target] [–no-overwrite] or with npx: $ npx add-dependencies [package_file] … Read more