我是一个新的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>
...
请帮帮我。 感谢。
答案 0 :(得分:1)
我已经解决了这个问题。 节点4.x不支持Contextify。 所以我将节点降级到0.10.x,然后工作正常。
抱歉我的声音。
答案 1 :(得分:0)
我的第一个想法是查看package.json
文件并检查错误。另请查看package.json
中包含的versions of each npm package并确保它们是最新版本。
package.json
中的define the latest version of node。
Javascript /节点库可以定期更新,如果您正在阅读教程,则可能需要更新一些软件包版本