NPM 3 Beta brings good news to Windows users and good news to npm

Source: Internet
Author: User

NPM 3 Beta brings good news to Windows users and good news to npm

This article is from the article I translated on InfoQ Chinese site, the original address is: http://www.infoq.com/cn/news/2015/06/angular-2-react-native-roadmap


Recently, the npm 3.0 Beta version has been released. This version almost completely overwrites the installer, bringing good news to users who use Node. js on Windows.

Rebecca Turner said in the release statement that the npm team was "very happy and proud" to release the 3.0 Beta version and "wanted to work with the npm user community to release the production version as soon as possible ".

Turner is a CLI programmer responsible for almost all changes. She said the update took about 8 months.

One of the most important changes of npm is dependency update. With the help of horizontal dependency, you can solve the problem that too many dependencies cause Windows file system to crash, because too many paths will cause difficulties that Explorer and other standard tools cannot handle.

Turner said:

Now, dependencies are installed horizontally. All dependencies and dependencies are installed in the node_modules directory of the project without nesting. If the dependencies between two or more modules conflict, nesting occurs between modules.

This update also means that the installation "from the beginning" is de-duplicated, Git deps is de-duplicated, and even commands are also de-duplicated.

Turner told InfoQ that, as a user, she felt the most exciting thing was automatic de-duplication of deps, which would "greatly reduce the size of the installation package ".

Other commands are also affected by dependency updates. In this updatenpm uninstallWhen the command is run to uninstall a module, the system deletes all dependencies that are not required by other modules. In the past, the dependencies installed under the module were deleted. It is worth noting that npm's dependencies are "horizontal, de-duplicated, and packaged". Therefore, npm 3.0 cannot be released or packaged by npm 2.0.

Other changes to the installer also improve the npm's steps for running the package. In earlier versions, the installer immediately performs the steps when deciding to process the package. In 3.0, the installer will perform various steps for all packages at the same time, and wait until the completion of each phase continues. For developers, doing so can eliminate many competing conditions: making coding easier.

From a practical perspective, Turner said that this update means that, for example, lifecycle scripts will become more predictable and error-prone, and at the same time, it will be easier to implement new--dry-runAnd other features. Turner said this would allow developers to see what is going to happen before execution, and detailed logs will show the complete tree structure before and after the installer changes.

All in all, Turner hopes that the npm 3.0 Beta version can reduce bugs and provide developers with a more stable platform.

As expected, the npm 3.0 Beta version will last for a period of time until the team "considers it stable enough and evaluates its impact on the Community" is released. Turner also pointed out that due to this almost complete rewriting, there will be some bugs. This Beta version can only be used for "non-critical CI environments used every day ", it cannot be used for "product maintenance or continuous deployment ".

For InfoQ readers who want to contribute to npm, there are many methods: conventional pull requests, Bug reports, documentation and code change feature requests. These are all welcome by npm, this can be done on the issue tracker. In addition to their direct contributions, the npm team also welcomes you to write tutorials and articles in the form of "how to solve a problem and what modules are used ", excellent content will be referenced by npm Weekly.

View Original English text:NPM 3 Beta Brings Good News for Windows Users

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.