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 rewritten the installer, brought good news for users who use node. js on Windows.

Rebecca Turner said in an announcement that the NPM team was "very happy and proud" to publish the 3.0 beta, and "would like to work with the NPM user community to release the production version number as soon as possible."

Turner is the CLI program ape, responsible for almost all the changes, she said the update took about 8 months time.

One of NPM's most important changes is the dependency update. With the help of horizontal dependencies, too many dependencies can cause the Windows file system to crash, because deep paths can cause problems that the explorer and other standard tools cannot handle.

Turner said:

today, dependencies will install as horizontally as possible, rely on them all, and rely on dependencies that are installed in the project's Node_modules folder and are no longer nested.

Suppose 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 "from the beginning" 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 her own initiative to go to the heavy deps, which will "greatly reduce the size of the installation package."

The behavior of other commands is also affected by dependency updates. In this update, when you use npm uninstall a command to unload a module. The system removes all dependencies that are not required by other modules in the module, whereas in the past it removes dependencies installed under the module.

It's worth noting that. NPM relies on its own "level and weight." and packaged ", so NPM 3.0 cannot be advertised or packaged by NPM 2.0.

Other changes to the installer have also improved NPM's running steps for the package. In the previous version number, the installer would run the steps immediately when deciding to process the package. In 3.0, the installer will run various steps for all packages at the same time. It waits for each stage to complete before continuing. For developers, this can eliminate very many race conditions: making code easier to write.

From a practical point of view, Turner says the update means that life-cycle scripting will become more predictable and less likely to go wrong. It is also easier to implement features such as new logos at the same time --dry-run . Turner says this will allow developers to see what is going on before they run. At the same time, 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 "feels it is stable enough and assesses its impact on the community" before releasing the official version.

Turner also pointed out that because this is almost completely rewritten, there will be some bugs, the beta version can only be used for "non-critical CI environment used every day." Cannot be used for "product maintenance or continuous deployment".

For Infoq readers who want to contribute to NPM. There are many ways to do it: regular pull requests, bug reports, feature requests for documents and code changes, and so on, all of which are welcome by NPM. Can be performed on its problem tracker. In addition to direct contributions. The NPM team also welcomes you to write tutorials and articles. Forms such as "How to solve a problem and what modules to use", 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.