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

Build Error: Go: go.mod file not found & NPM: Unsupport Engine #4257

Closed
Eroge-Newton opened this issue Aug 19, 2024 · 6 comments
Closed

Build Error: Go: go.mod file not found & NPM: Unsupport Engine #4257

Eroge-Newton opened this issue Aug 19, 2024 · 6 comments

Comments

@Eroge-Newton
Copy link

I built YCM two years ago on my new laptop(Ubuntu 22.04) and it works fine.
Today, I try to build YCM on a VPS(Ubuntu 22.04) but something wrong.

I want to build go , ts and mono completer, but only mono compiles successfully.

I've looked up issues and installation guides, as well as the detailed compilation guide, but there's not much information that solves the problem.

System and software info:

OS: Ubuntu 22.04.4 LTS 
Memery: 2 GB 
Disk: 20 GB 
Kernel: 6.5.0-18-generic 

Vim: 8.2.3995 
Python: 3.10 
mono: 6.8.0.105 
go: 1.18.1 LTS 
nodejs: 12.22.9 
npm: 8.5.1 

While I trying to compile go:

$ python3 ./install.py --verbose --cs-completer --go-completer --ts-completer

# The ending part
third_party/go/pkg/mod/golang.org/x/tools/[email protected]/internal/golang/comment.go:12:2: package go/doc/comment is not in GOROOT (/usr/lib/go-1.18/src/go/doc/comment)
go: go.mod file not found in current directory or any parent directory.
        'go get' is no longer supported outside a module.
        To build and install a command, use 'go install' with a version,
        like 'go install example.com/cmd@latest'
        For more information, see https://golang.org/doc/go-get-install-deprecation
        or run 'go help get' or 'go help install'.
$ 

What's more, if just compile TypeScript completer, will get the "Unsupported Engine" warnning message.

$ python3 ./install.py --verbose --cs-completer --ts-completer

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=14.17' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
$

YCM log:

:Ycm
Printing YouCompleteMe debug information...                                                                                  
-- Resolve completions: Never                                                                                                
-- Client logfile: /tmp/ycm_b8yxng5a.log                                                                                     
-- Server Python interpreter: /usr/bin/python3                                                                               
-- Server Python version: 3.10.12                                                                                            
-- Server has Clang support compiled in: False                                                                               
-- Clang version: None                                                                                                       
-- Extra configuration file found and loaded                                                                                 
-- Extra configuration path: /home/tmp/.vim/plugged/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py                        
-- Server running at: http://127.0.0.1:55357                                                                                 
-- Server process ID: 15438                                                                                                  
-- Server logfiles:                                                                                                          
--   /tmp/ycmd_55357_stdout_b0_ff4bz.log                                                                                     
--   /tmp/ycmd_55357_stderr_aes77liw.log                                                                                     
-- Semantic highlighting supported: True                                                                                     
-- Virtual text supported: False                                                                                             
-- Popup windows supported: True                                                                                             
Press ENTER or type command to continue    



:YcmToggleLogs                                                                                                               
Which logfile do you wish to open (or close if already open)?                                                                
1: tsserver_5hyq8_co.log                                                                                                     
2: ycm_z_d6al82.log                                                                                                          
3: ycmd_37645_stderr_n6x9u6_6.log                                                                                            
4: ycmd_37645_stdout_960a_51t.log                                                                                            
Type number and <Enter> or click with the mouse (q or empty cancels):   

Full log with --verbose :
Full-log--verbose.txt

@Eroge-Newton
Copy link
Author

After testing, the low version of NPM that comes with Ubuntu 22.04 doesn't seem to affect usage.
But Go...

@Yuanhao-JIANG
Copy link

similar GO bug here

Building gopls for go completion...# golang.org/x/telemetry/crashmonitor
third_party/go/pkg/mod/golang.org/x/[email protected]/crashmonitor/crash_go123.go:13:19: cannot use debug.SetCrashOutput (value of type func(f *os.File, opts debug.CrashOptions) error) as func(*os.File) error value in assignment

FAILED
Trying legacy get get...go: go.mod file not found in current directory or any parent directory.
	'go get' is no longer supported outside a module.
	To build and install a command, use 'go install' with a version,
	like 'go install example.com/cmd@latest'
	For more information, see https://golang.org/doc/go-get-install-deprecation
	or run 'go help get' or 'go help install'.

FAILED

@bstaletic
Copy link
Collaborator

@Yuanhao-JIANG It is gopls related, but not similar. You need to check out the latest ycmd. Try

git submodule update --remote
./install.py --whatever-args-you-use

@Yuanhao-JIANG
Copy link

@Yuanhao-JIANG It is gopls related, but not similar. You need to check out the latest ycmd. Try

git submodule update --remote
./install.py --whatever-args-you-use

Thanks, that works. I am using vim plug for that, do I leave it like that and update as usual next time though VimPlug, or I run this command next time manually when we have an update?

@bstaletic
Copy link
Collaborator

@Yuanhao-JIANG Now that #4259 has been merged, you will be able to update normally. The pull request simply did the same thing you did manualy with the git submodule command.

@bstaletic
Copy link
Collaborator

With #4260 updating the docs for Ubuntu 24.04 and #4259 updating the gopls that we pull in, I think we can close this issue.
The problem on Ubuntu 22.04 is that it ships an old go compiler and users need a PPA in order to upgrade.

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

No branches or pull requests

3 participants