npm install在Kudu上什么都不做 [英] npm install just do nothing on Kudu
问题描述
今天早上,我运行npm install
,并创建了node_modules
,其中包含所有文件.
This morning I run npm install
and the node_modules
was created with all the files in it.
然后,几个小时后,我运行相同的命令相同的package.json文件...没有错误,创建了node_modules
,但为空!?
Then a few hour after, I run the same command same package.json file... no error, node_modules
was created, but empty!?
有什么想法吗?
这是我的package.json,非常正常,它是通过npm init添加tedious
包生成的.
Here my package.json, very regular generated via an npm init adding tedious
package.
{
"name": "tedious",
"version": "2.1.1",
"description": "COnnect to Database",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tediousjs/tedious.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/tediousjs/tedious/issues"
},
"homepage": "https://github.com/tediousjs/tedious#readme"
}
推荐答案
您的package.json
中没有dependencies
.
您需要将要安装的npm模块添加到package.json
的dependencies
部分,然后运行npm install
进行下载.
You'll need to add the npm modules you want to install into the dependencies
section of your package.json
, and then run npm install
to download them.
"dependencies": {
"tedious": "^2.1.1",
"express": "^4.14.0",
...................
}
或者,您可以使用命令npm install <package_name> --save
来做到这一点.
Alternatively, you can use the command npm install <package_name> --save
to do that.
参考:使用package.json .
这篇关于npm install在Kudu上什么都不做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!