npm安装后在哪里查找库文件

时间:2023-01-17 23:58:04

I am installing nodejs module(jasmine-ajax) in my local machine . I am expecting the entire libraries in git hub will be available in my local system. But I am seeing only the main file in lib folder . Where the other dependend files will be placed.

我在本地机器上安装nodejs模块(jasmine-ajax)。我期待git hub中的整个库将在我的本地系统中可用。但我只看到lib文件夹中的主文件。将放置其他dependend文件的位置。

npm install --save-dev jasmine-ajax

npm install --save-dev jasmine-ajax

Executed the above command and I am not seeing all the files under source in my local view.

执行上面的命令,我没有在本地视图中看到源下的所有文件。

https://github.com/jasmine/jasmine-ajax

https://github.com/jasmine/jasmine-ajax

Thanks

谢谢

3 个解决方案

#1


2  

When you install a module like you did, it is placed in node_modules folder. Running npm install is not getting all file from github repository, but from architecture that is pushed to npm. In the jasmine-ajax github, you can see a file called .npmignore which contains src. This file works like .gitignore files, src folder is excluded when he pushed is module to npm.

当您像安装模块一样安装模块时,它将放在node_modules文件夹中。运行npm install不是从github存储库获取所有文件,而是从推送到npm的体系结构获取。在jasmine-ajax github中,您可以看到一个名为.npmignore的文件,其中包含src。这个文件就像.gitignore文件一样,当他将模块推送到npm时,src文件夹被排除在外。

File in lib folder is generated from src folder files, so it contains all you want

lib文件夹中的文件是从src文件夹文件生成的,因此它包含您想要的所有内容

#2


0  

mock-ajax.js file, in lib folder, represents the built library. You don't need to have all files in src when you download it from npm. You can use all jasmine-ajax features in this way:

lib文件夹中的mock-ajax.js文件代表构建的库。从npm下载时,您不需要在src中拥有所有文件。您可以通过以下方式使用所有jasmine-ajax功能:

Install jasmine-ajax from NPM via npm install --save-dev jasmine-ajax; you can then require('jasmine-ajax') inside your test-suite and access it via the jasmine global.

通过npm install --save-dev jasmine-ajax从NPM安装jasmine-ajax;然后,您可以在测试套件中要求('jasmine-ajax')并通过jasmine global访问它。

#3


0  

When you launch a npm install without the -g flag the folder that you have to look for is node_modules in the path where you launched the command.

当您启动不带-g标志的npm安装时,您必须查找的文件夹是启动命令的路径中的node_modules。

If you use -g flag it will be installed as a global module.

如果使用-g标志,它将作为全局模块安装。

In your case the folder will be node_modules/jasmine-ajax.

在您的情况下,该文件夹将是node_modules / jasmine-ajax。

npm安装后在哪里查找库文件

The fact that the lib folder contains only the mock-ajax.js file depends on the release they made on npm registry.

lib文件夹仅包含mock-ajax.js文件的事实取决于它们在npm注册表上发布的版本。

The npm install command DOES NOT clone the github repository, it downloads the release from the npm registry: https://www.npmjs.com/package/jasmine-ajax

npm install命令不会克隆github存储库,它会从npm注册表下载该版本:https://www.npmjs.com/package/jasmine-ajax

#1


2  

When you install a module like you did, it is placed in node_modules folder. Running npm install is not getting all file from github repository, but from architecture that is pushed to npm. In the jasmine-ajax github, you can see a file called .npmignore which contains src. This file works like .gitignore files, src folder is excluded when he pushed is module to npm.

当您像安装模块一样安装模块时,它将放在node_modules文件夹中。运行npm install不是从github存储库获取所有文件,而是从推送到npm的体系结构获取。在jasmine-ajax github中,您可以看到一个名为.npmignore的文件,其中包含src。这个文件就像.gitignore文件一样,当他将模块推送到npm时,src文件夹被排除在外。

File in lib folder is generated from src folder files, so it contains all you want

lib文件夹中的文件是从src文件夹文件生成的,因此它包含您想要的所有内容

#2


0  

mock-ajax.js file, in lib folder, represents the built library. You don't need to have all files in src when you download it from npm. You can use all jasmine-ajax features in this way:

lib文件夹中的mock-ajax.js文件代表构建的库。从npm下载时,您不需要在src中拥有所有文件。您可以通过以下方式使用所有jasmine-ajax功能:

Install jasmine-ajax from NPM via npm install --save-dev jasmine-ajax; you can then require('jasmine-ajax') inside your test-suite and access it via the jasmine global.

通过npm install --save-dev jasmine-ajax从NPM安装jasmine-ajax;然后,您可以在测试套件中要求('jasmine-ajax')并通过jasmine global访问它。

#3


0  

When you launch a npm install without the -g flag the folder that you have to look for is node_modules in the path where you launched the command.

当您启动不带-g标志的npm安装时,您必须查找的文件夹是启动命令的路径中的node_modules。

If you use -g flag it will be installed as a global module.

如果使用-g标志,它将作为全局模块安装。

In your case the folder will be node_modules/jasmine-ajax.

在您的情况下,该文件夹将是node_modules / jasmine-ajax。

npm安装后在哪里查找库文件

The fact that the lib folder contains only the mock-ajax.js file depends on the release they made on npm registry.

lib文件夹仅包含mock-ajax.js文件的事实取决于它们在npm注册表上发布的版本。

The npm install command DOES NOT clone the github repository, it downloads the release from the npm registry: https://www.npmjs.com/package/jasmine-ajax

npm install命令不会克隆github存储库,它会从npm注册表下载该版本:https://www.npmjs.com/package/jasmine-ajax