Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 清理在Heroku部署上不工作的html npm模块_Javascript_Html_Node.js_Heroku - Fatal编程技术网

Javascript 清理在Heroku部署上不工作的html npm模块

Javascript 清理在Heroku部署上不工作的html npm模块,javascript,html,node.js,heroku,Javascript,Html,Node.js,Heroku,我在node.js和express应用程序上安装了sanitize html npm库。我正在使用Cloud9IDE,它可以预览您的站点。Sanitize html完成了它的工作,并在预览中完美地工作,但是当我尝试使用heroku将我的应用程序部署到web时,我得到了一个应用程序错误。我知道这个错误是由于清理html造成的,因为当我删除它并部署我的应用程序时,一切正常。这是我的heroku日志: 2016-02-22T16:35:13.344238+00:00 heroku[web.1]: St

我在node.js和express应用程序上安装了sanitize html npm库。我正在使用Cloud9IDE,它可以预览您的站点。Sanitize html完成了它的工作,并在预览中完美地工作,但是当我尝试使用heroku将我的应用程序部署到web时,我得到了一个应用程序错误。我知道这个错误是由于清理html造成的,因为当我删除它并部署我的应用程序时,一切正常。这是我的heroku日志:

2016-02-22T16:35:13.344238+00:00 heroku[web.1]: State changed from crashed to starting
2016-02-22T16:35:14.684861+00:00 heroku[web.1]: Starting process with command `npm start`
2016-02-22T16:35:06.369072+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sharecookie.herokuapp.com request_id=b37b7b05-5b82-4668-80fb-5714a0ddbc61 fwd="207.74.9.2" dyno= connect= service= status=503 bytes=
2016-02-22T16:35:15.916200+00:00 app[web.1]: 
2016-02-22T16:35:15.916220+00:00 app[web.1]: > node bin/www
2016-02-22T16:35:15.916221+00:00 app[web.1]: 
2016-02-22T16:35:16.489614+00:00 app[web.1]: npm ERR! Linux 3.13.0-77-generic
2016-02-22T16:35:16.472662+00:00 app[web.1]: module.js:341
2016-02-22T16:35:16.472665+00:00 app[web.1]:     throw err;
2016-02-22T16:35:16.489936+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-02-22T16:35:16.490118+00:00 app[web.1]: npm ERR! node v5.6.0
2016-02-22T16:35:16.472666+00:00 app[web.1]:     ^
2016-02-22T16:35:16.472667+00:00 app[web.1]: 
2016-02-22T16:35:16.472668+00:00 app[web.1]: Error: Cannot find module 'sanitize-html'
2016-02-22T16:35:16.472670+00:00 app[web.1]:     at Module.require (module.js:367:17)
2016-02-22T16:35:16.472670+00:00 app[web.1]:     at require (internal/module.js:16:19)
2016-02-22T16:35:16.472671+00:00 app[web.1]:     at Object.<anonymous> (/app/routes/index.js:11:20)
2016-02-22T16:35:16.472671+00:00 app[web.1]:     at Module._compile (module.js:413:34)
2016-02-22T16:35:16.472672+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:422:10)
2016-02-22T16:35:16.472676+00:00 app[web.1]:     at Object.<anonymous> (/app/app.js:14:14)
2016-02-22T16:35:16.472677+00:00 app[web.1]:     at Module._compile (module.js:413:34)
2016-02-22T16:35:13.344238+00:00 heroku[web.1]:状态从崩溃变为启动
2016-02-22T16:35:14.684861+00:00 heroku[web.1]:使用命令“npm start”启动进程`
2016-02-22T16:35:06.369072+00:00 heroku[路由器]:at=错误代码=H10 desc=“应用程序崩溃”方法=GET path=“/”主机=sharecookie.herokuapp.com请求\u id=b37b7b05-5b82-4668-80fb-5714a0ddbc61 fwd=“207.74.9.2”dyno=connect=service=status=503字节=
2016-02-22T16:35:15.916200+00:00应用程序[网站1]:
2016-02-22T16:35:15.916220+00:00应用程序[web.1]:>node bin/www
2016-02-22T16:35:15.916221+00:00应用程序[网站1]:
2016-02-22T16:35:16.489614+00:00应用程序[网站1]:npm错误!Linux 3.13.0-77-generic
2016-02-22T16:35:16.472662+00:00 app[web.1]:module.js:341
2016-02-22T16:35:16.472665+00:00应用程序[web.1]:抛出错误;
2016-02-22T16:35:16.489936+00:00应用程序[web.1]:npm错误!argv“/app/.heroku/node/bin/node”“/app/.heroku/node/bin/npm”“开始”
2016-02-22T16:35:16.490118+00:00应用程序[网站1]:npm错误!节点v5.6.0
2016-02-22T16:35:16.472666+00:00应用程序[网站1]:^
2016-02-22T16:35:16.472667+00:00应用程序[网站1]:
2016-02-22T16:35:16.472668+00:00应用程序[web.1]:错误:找不到模块“清理html”
2016-02-22T16:35:16.472670+00:00应用程序[web.1]:位于Module.require(Module.js:367:17)
2016-02-22T16:35:16.472670+00:00应用程序[web.1]:根据需要(内部/模块js:16:19)
2016-02-22T16:35:16.472671+00:00应用程序[web.1]:at对象。(/app/routes/index.js:11:20)
2016-02-22T16:35:16.472671+00:00应用程序[网站1]:at模块编译(模块js:413:34)
2016-02-22T16:35:16.472672+00:00应用程序[web.1]:at Object.Module.\u extensions..js(Module.js:422:10)
2016-02-22T16:35:16.472676+00:00应用程序[web.1]:at对象。(/app/app.js:14:14)
2016-02-22T16:35:16.472677+00:00应用程序[网站1]:at模块编译(模块js:413:34)

诸如此类,它说它找不到“sanitize html”模块,即使它安装在node_模块中,并在我的index.js中引用为
var sanitizeHtml=require('sanitize-html')这真是令人沮丧。感谢您的帮助:)

我在浏览其他问题时找到了答案。我需要使用
git add-A--force
来完全重新添加我的所有模块,这就成功了。有点奇怪