Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "engines" in package.json to specify Node version #2887

Closed
jgbradley1 opened this issue Sep 16, 2018 · 1 comment · Fixed by #5966
Closed

Use "engines" in package.json to specify Node version #2887

jgbradley1 opened this issue Sep 16, 2018 · 1 comment · Fixed by #5966

Comments

@jgbradley1
Copy link
Contributor

I have been building Theia docker images on top of Centos 7. I kept getting an error message (copy/pasted below) when using node v10 and trying to run yarn. It seems that some of the vscode components are not ready for Node v10 just yet. It works for Node v8. Node v8 should be enforced in the package.json file via the "engines" tag so other developers are not misled.

error /theia-app/node_modules/vscode-nsfw: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /theia-app/node_modules/vscode-nsfw
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp http GET https://nodejs.org/download/release/v10.10.0/node-v10.10.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v10.10.0/node-v10.10.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v10.10.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v10.10.0/SHASUMS256.txt
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/theia-app/node_modules/vscode-nsfw/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/root/.node-gyp/10.10.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/root/.node-gyp/10.10.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/root/.node-gyp/10.10.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/theia-app/node_modules/vscode-nsfw',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory /theia-app/node_modules/vscode-nsfw/build' CXX(target) Release/obj.target/nsfw/src/NSFW.o ../src/NSFW.cpp: In static member function 'static void NSFW::fireErrorCallback(uv_async_t*)': ../src/NSFW.cpp:56:44: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated (declared at ../../nan/nan.h:1647) [-Wdeprecated-declarations] baton->nsfw->mErrorCallback->Call(1, argv); ^ ../src/NSFW.cpp: In static member function 'static void NSFW::fireEventCallback(uv_async_t*)': ../src/NSFW.cpp:98:44: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated (declared at ../../nan/nan.h:1647) [-Wdeprecated-declarations] baton->nsfw->mEventCallback->Call(1, argv); ^ ../src/NSFW.cpp: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE NSFW::JSNew(Nan::NAN_METHOD_ARGS_TYPE)': ../src/NSFW.cpp:159:49: error: no matching function for call to 'v8::Function::NewInstance()' info.GetReturnValue().Set(cons->NewInstance()); ^ ../src/NSFW.cpp:159:49: note: candidates are: In file included from /root/.node-gyp/10.10.0/include/node/node.h:63:0, from ../../nan/nan.h:52, from ../src/../includes/NSFW.h:5, from ../src/NSFW.cpp:1: /root/.node-gyp/10.10.0/include/node/v8.h:3989:44: note: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( ^ /root/.node-gyp/10.10.0/include/node/v8.h:3989:44: note: candidate expects 3 arguments, 0 provided /root/.node-gyp/10.10.0/include/node/v8.h:3992:44: note: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( ^ /root/.node-gyp/10.10.0/include/node/v8.h:3992:44: note: candidate expects 1 argument, 0 provided ../src/NSFW.cpp:177:54: warning: 'v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)' is deprecated (declared at /root/.node-gyp/10.10.0/include/node/v8.h:2887): Use Isolate version [-Wdeprecated-declarations] v8::String::Utf8Value utf8Value(info[1]->ToString()); ^ ../src/NSFW.cpp: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE NSFW::Start(Nan::NAN_METHOD_ARGS_TYPE)': ../src/NSFW.cpp:208:27: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated (declared at ../../nan/nan.h:1647) [-Wdeprecated-declarations] callback->Call(1, argv); ^ ../src/NSFW.cpp: In member function 'virtual void NSFW::StartWorker::HandleOKCallback()': ../src/NSFW.cpp:254:27: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated (declared at ../../nan/nan.h:1647) [-Wdeprecated-declarations] callback->Call(1, argv); ^ ../src/NSFW.cpp:256:27: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated (declared at ../../nan/nan.h:1647) [-Wdeprecated-declarations] callback->Call(0, NULL); ^ ../src/NSFW.cpp: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE NSFW::Stop(Nan::NAN_METHOD_ARGS_TYPE)': ../src/NSFW.cpp:281:27: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated (declared at ../../nan/nan.h:1647) [-Wdeprecated-declarations] callback->Call(1, argv); ^ ../src/NSFW.cpp: In member function 'virtual void NSFW::StopWorker::HandleOKCallback()': ../src/NSFW.cpp:323:25: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated (declared at ../../nan/nan.h:1647) [-Wdeprecated-declarations] callback->Call(0, NULL); ^ make: *** [Release/obj.target/nsfw/src/NSFW.o] Error 1 make: Leaving directory /theia-app/node_modules/vscode-nsfw/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.9.93-linuxkit-aufs
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /theia-app/node_modules/vscode-nsfw
gyp ERR! node -v v10.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

@kittaakos
Copy link
Contributor

Similar if not duplicate: #2009
Also: #2880

vince-fugnitto added a commit that referenced this issue Aug 16, 2019
Fixes #2887

- align our `engines` tag in `package.json` found at the root
of the repository with the prerequisites. This will fail to compile
the code if there is an unsupported node version being used.

Signed-off-by: Vincent Fugnitto <[email protected]>
vince-fugnitto added a commit that referenced this issue Aug 16, 2019
Fixes #2887

- align our `engines` tag in `package.json` found at the root
of the repository with the prerequisites. This will fail to compile
the code if there is an unsupported node version being used.

Signed-off-by: Vincent Fugnitto <[email protected]>
vince-fugnitto added a commit that referenced this issue Aug 19, 2019
Fixes #2887

- align our `engines` tag in `package.json` found at the root
of the repository with the prerequisites. This will fail to compile
the code if there is an unsupported node version being used.

Signed-off-by: Vincent Fugnitto <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants