我已经使用 Netlify 和 git 存储库进行了持续部署设置,但到目前为止,无论我做什么,Netlify 都没有npm-install执行任何操作。当我下载部署的 zip 时,没有node_modules 文件夹,我的站点无法访问node_modules,它不在那里。我已经开始使用随机的 npm 包(lodash)来尝试安装它,但到目前为止我什么也没得到。
Netlify 说它会自动运行npm install。我尝试过不使用构建命令,也尝试添加npm install为构建命令,但都没有结果。
包.json:
{
"name": "netlify-test",
"version": "1.0.0",
"description": "stuff",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/electrovir/netlify-test.git"
},
"author": "electrovir",
"license": "MIT",
"bugs": {
"url": "https://github.com/electrovir/netlify-test/issues"
},
"homepage": "https://github.com/electrovir/netlify-test#readme",
"dependencies": {
"lodash": "^4.17.11"
}
}
Run Code Online (Sandbox Code Playgroud)
HTML:
{
"name": "netlify-test",
"version": "1.0.0",
"description": "stuff",
"main": "index.js",
"scripts": {
"test": …Run Code Online (Sandbox Code Playgroud)