NPM 3 Beta brings positive news to Windows users

Source: Internet
Author: User

This article is from my translation of the Infoq Chinese station, the original address is: Http://www.infoq.com/cn/news/2015/06/angular-2-react-native-roadmap


Recently, the NPM 3.0 beta release, which almost completely rewrites the installer, brings good news for users who use node. js on Windows.

Rebecca Turner said in a statement that the NPM team was "happy and proud" to have released the 3.0 beta, and "wanted to work with the NPM user community to release the production version as soon as possible."

Turner, the CLI programmer, was responsible for almost all the changes, and she said the update took about 8 months.

One of the most important changes to NPM is dependent updates. Relying on a horizontal dependency can solve the problem that too many dependencies cause Windows file system crashes, because a path that is too deep can cause problems that the explorer and other standard tools cannot handle.

Turner said:

dependencies will now be installed as horizontally as possible, with all dependencies and dependent dependencies installed in the project's Node_modules directory and no longer nested. If there is a conflict between the dependencies of two or more modules, then there is a case of nesting between the modules.

This update also means that the installation of "from the start" is to go heavy, Git deps is to go heavy, even the command is "go heavy".

Turner said to Infoq that as a user, she felt that the most exciting thing was the automatic deps, which "greatly reduces the size of the installation package."

The behavior of other commands is also affected by dependency updates. In this update, when you use a npm uninstall command to unload a module, the system removes all dependencies that are not required by other modules in the module, and in the past deletes the dependencies installed under that module. It is worth noting that NPM itself relies on "horizontal, heavy, and packaged", so NPM 3.0 cannot be released or packaged by NPM 2.0.

Other changes to the installer have improved NPM's execution steps for the package. In previous releases, the installer executed the steps as soon as it decided to process the package. In 3.0, the installer performs the steps for all packages at the same time, waiting for each phase to complete before continuing. For developers, this eliminates a lot of race conditions: Making code easier to write.

From a practical point of view, Turner says the update means that life-cycle scripting, for example, will become more predictable and less likely to go wrong, while also making it easier to implement features such as new --dry-run flags. Turner says this will allow developers to see what is going on before they execute, while a detailed log will show the complete tree structure before and after the installer changes.

All in all, Turner hopes that the NPM 3.0 beta version will reduce bugs and provide developers with a more stable platform.

As expected, the NPM 3.0 beta will continue for some time until the team "believes it is stable enough and evaluates its impact on the community" before releasing the official version. Turner also pointed out that because of this almost complete rewrite, there will be some bugs, the beta version can only be used for "non-critical CI environment used every day", not for "product maintenance or continuous deployment."

There are a number of ways for Infoq readers who want to contribute to NPM: Regular pull requests, bug reports, feature requests for documents and code changes, and so on, which NPM is welcome to do on its issue tracker. In addition to direct contributions, the NPM team also welcomes you in writing tutorials and articles in the form of "How to solve a problem and what modules to use", and good content will be referenced by NPM weekly.

View English text: NPM 3 Beta brings good News for Windows Users

NPM 3 Beta brings positive news to 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.