推到Heroku错误:contextify@0.1.14安装

我是一个新的node.js开发人员。 我试图推我的node.js应用程序到Heroku,但我不断收到一些错误如下,但不知道如何去解决它。

-----> Building dependencies Pruning any extraneous modules Installing node modules (package.json) > contextify@0.1.14 install /tmp/build_7fb89e69944f674de0fcbcbe650a0b7b/lucinkudumov-galdraland-dfa13e5/node_modules/email-templates/node_modules/juice/node_modules/jsdom/node_modules/contextify > node-gyp rebuild (node) child_process: options.customFds option is deprecated. Use options.stdio instead. make: Entering directory `/tmp/build_7fb89e69944f674de0fcbcbe650a0b7b/lucinkudumov-galdraland-dfa13e5/node_modules/email-templates/node_modules/juice/node_modules/jsdom/node_modules/contextify/build' CXX(target) Release/obj.target/contextify/src/contextify.o In file included from ../src/contextify.cc:3:0: ../node_modules/nan/nan.h:261:25: error: redefinition of 'template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)' NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) { ^ ../node_modules/nan/nan.h:256:25: error: 'template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)' previously declared here NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) { ^ ../node_modules/nan/nan.h:661:13: error: 'node::smalloc' has not been declared , node::smalloc::FreeCallback callback ^ ../node_modules/nan/nan.h:661:35: error: expected ',' or '...' before 'callback' , node::smalloc::FreeCallback callback ^ ../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)': ../node_modules/nan/nan.h:665:50: error: 'callback' was not declared in this scope v8::Isolate::GetCurrent(), data, length, callback, hint); ^ ../node_modules/nan/nan.h:665:60: error: 'hint' was not declared in this scope v8::Isolate::GetCurrent(), data, length, callback, hint); ^ ../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)': ../node_modules/nan/nan.h:672:67: error: call of overloaded 'New(v8::Isolate*, const char*&, uint32_t&)' is ambiguous return node::Buffer::New(v8::Isolate::GetCurrent(), data, size); ^ ../node_modules/nan/nan.h:672:67: note: candidates are: In file included from ../node_modules/nan/nan.h:25:0, from ../src/contextify.cc:3: /app/.node-gyp/4.1.2/src/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match> NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, ^ /app/.node-gyp/4.1.2/src/node_buffer.h:31:40: note: no known conversion for argument 3 from 'uint32_t {aka unsigned int}' to 'node::encoding' /app/.node-gyp/4.1.2/src/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match> 

请帮帮我。 谢谢。

我已经解决了这个问题。 Contextify在节点4.x中不受支持。 所以我把节点降级到了0.10.x,然后工作正常。

对不起我的噪音。

我的第一个想法是查看package.json文件并检查错误。 同时检查包含在package.json 的每个npm包的版本,并确保它们是最新版本。

还要在package.json 定义最新版本的节点 。

Javascript /节点库可以定期更新,如果你正在按照教程,你可能需要更新一些软件包版本