npm update is not updating the version in package.json file

The objective of the npm update command is to update your package-lock.json according to what you have specified in the package.json file. This is the normal behavior. If you want to update your package.json file, you can use npm-check-updates: npm install -g npm-check-updates. You can then use these commands: ncu Checks for updates from the … Read more

How do I fix npm’s global location?

npm uses a .npmrc file which should be in your home directory. (ie ~/.npmrc) In this file you should see a key value pair with the key being “prefix”. Try setting the value to something like “/usr/lib64”. So your .npmrc file would have the following in addition to whatever else you put in it: prefix … Read more

Should changes in a package.json file be commited to a repository as well?

You need to commit package.json. All other developers, after pulling the code, will just need to perform npm install to get the latest dependencies required for the project. Whenever you or someone else wants to add new dependencies to the project you perform npm install <dependencyName> or npm install –save-dev <dependencyName>. Then package.json is automatically … Read more

npm throws ENOENT warnings on every install/uninstall/ls

Error message might be caused by missing package.json file. Change directory to your project’s local directory, as an example (instead, use current working directory of your project): cd /var/www/nodeBot Following string will write package.json: npm init Answer menu-driven questions or use –yes to blast past them. Then press enter at the end to write out … Read more

How can I setup webpack to minify and combine scss and javascript like CodeKit?

Introduction Webpack is mainly a JavaScript-bundler. Its “native” language is JavaScript and every other source requires a loader which transforms it to JavaScript. If you require() an html-file for example… var template = require(“./some-template.html”); …you’ll need the html-loader. It turns… <div> <img src=”https://stackoverflow.com/questions/26851120/./assets/img.png”> </div> …into… module.exports = “<div>\n <img src=\”” + require(“https://stackoverflow.com/questions/26851120/./assets/img.png”) + “\”>\n</div>”; If … Read more

How to use third party npm packages with ember cli app

The easiest and recommended answer is to use ember-browserify. (as support for bower packages will be removed in the future.) This is an example for using the npm package dexie within an Ember CLI app. Install browserify: npm install ember-browserify –save-dev Install dexie (or whatever module you need): npm install dexie –save-dev Import the module … Read more