【发布时间】:2019-02-05 03:47:25
【问题描述】:
我已经使用 Netlify 和 git repo 进行了持续部署设置,但到目前为止,无论我做什么,Netlify 都不是npm-installing 任何东西。当我下载部署的 zip 时没有 node_modules 文件夹,我的站点无法访问 node_modules,它只是不存在。我从一个随机的 npm 包 (lodash) 开始尝试安装它,但到目前为止我一无所获。
Netlify 说它会自动运行npm install。我试过没有构建命令,我尝试添加 npm install 作为构建命令,但没有任何结果。
package.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"
}
}
HTML:
<!doctype html>
<html>
<head>
<title>
hi
</title>
<script src="node_modules/lodash/_apply.js"></script>
</head>
<body>
Why can't this find node_modules??
</body>
</html>
【问题讨论】:
标签: npm-install netlify