npm install 在 Kudu 上什么都不做
npm install just do nothing on Kudu
今天早上我 运行 npm install
创建了 node_modules
,其中包含所有文件。
然后几个小时后,我 运行 相同的命令相同的 package.json 文件...没有错误,node_modules
已创建,但为空!?
有什么想法吗?
这里是我的 package.json,通过添加 tedious
包的 npm init 非常规律地生成。
{
"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
下载它们。
"dependencies": {
"tedious": "^2.1.1",
"express": "^4.14.0",
...................
}
或者,您可以使用命令 npm install <package_name> --save
来执行此操作。
今天早上我 运行 npm install
创建了 node_modules
,其中包含所有文件。
然后几个小时后,我 运行 相同的命令相同的 package.json 文件...没有错误,node_modules
已创建,但为空!?
有什么想法吗?
这里是我的 package.json,通过添加 tedious
包的 npm init 非常规律地生成。
{
"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
下载它们。
"dependencies": {
"tedious": "^2.1.1",
"express": "^4.14.0",
...................
}
或者,您可以使用命令 npm install <package_name> --save
来执行此操作。