microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.42k stars 29.33k forks source link

Installing dependencies with `yarn` yell that I can't use npm to install dependencies #39784

Closed DrakaSAN closed 6 years ago

DrakaSAN commented 6 years ago

Steps to Reproduce:

$ git clone --branch 1.18.1 --depth 1 https://github.com/Microsoft/vscode.git
$ cd vscode
$ yarn
yarn install v1.3.2
info No lockfile found.
$ node build/npm/preinstall.js
You can't use plain npm to install Code's dependencies.
Please run './scripts/npm.sh install' instead.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

I wanted to use the MIT version of vscode, so I downloaded the last version, installed yarn (tested via package manager and via npm), tried to install via yarn and... no luck.

It is similar to #38501, and npm_execpath is '/home/user/n/lib/node_modules/yarn/bin/yarn.js', which does exist.

I will try again later, and spend more time investigating what has gone wrong, but I wanted to leave a trace of this still happening.

joaomoreno commented 6 years ago

Strange... The regex should work, if that is indeed the value of npm_execpath. Just double check that.

DrakaSAN commented 6 years ago

Had the same problem on Manjaro Linux, which is set up the same way (same node/npm version, installed via n, yarn installed via npm), here is the process.env:

{
    npm_package_dependencies_iconv_lite: '0.4.15',
    npm_config_init_license: 'MIT',
    npm_package_devDependencies__types_mocha: '2.2.39',
    LS_COLORS: 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:',
    npm_package_devDependencies_cson_parser: '^1.3.3',
    npm_package_devDependencies_gulp_buffer: '0.0.2',
    npm_package_dependencies_graceful_fs: '4.1.11',
    LC_MEASUREMENT: 'fr_FR.UTF-8',
    npm_package_devDependencies_express: '^4.13.1',
    LC_PAPER: 'fr_FR.UTF-8',
    LC_MONETARY: 'fr_FR.UTF-8',
    XDG_MENU_PREFIX: 'xfce-',
    npm_package_scripts_update_grammars: 'node build/npm/update-all-grammars.js',
    npm_execpath: '/home/user/n/lib/node_modules/yarn/bin/yarn.js',
    npm_package_optionalDependencies_windows_foreground_love: '0.1.0',
    _: '/home/user/n/bin/node',
    npm_package_devDependencies_istanbul: '^0.3.17',
    npm_package_dependencies_getmac: '1.0.7',
    LANG: 'en_GB.utf8',
    npm_package_scripts_preinstall: 'node build/npm/preinstall.js',
    npm_package_dependencies_v8_profiler: 'jrieken/v8-profiler#vscode',
    YAOURT_COLORS: 'nb=1:pkg=1:ver=1;32:lver=1;45:installed=1;42:grp=1;34:od=1;41;5:votes=1;44:dsc=0:other=1;35',
    DISPLAY: ':0.0',
    npm_package_electronVersion: '1.7.9',
    npm_package_devDependencies_vscode_nls_dev: '^2.0.1',
    npm_package_devDependencies_gulp_bom: '^1.0.0',
    OLDPWD: '/home/user',
    npm_package_dependencies_vscode_textmate: '^3.2.0',
    EDITOR: '/usr/bin/nano',
    npm_package_scripts_smoketest: 'cd test/smoke && mocha',
    npm_package_scripts_compile: 'gulp compile --max_old_space_size=4096',
    COLORTERM: 'truecolor',
    npm_package_dependencies_semver: '4.3.6',
    npm_package_repository_url: 'https://github.com/Microsoft/vscode.git',
    npm_package_devDependencies_eslint: '^3.4.0',
    MOZ_PLUGIN_PATH: '/usr/lib/mozilla/plugins',
    npm_config_version_git_message: 'v%s',
    npm_package_devDependencies_vinyl: '^0.4.5',
    npm_config_user_agent: 'yarn/1.3.2 npm/? node/v8.9.2 linux x64',
    npm_package_devDependencies_documentdb: '^1.5.1',
    npm_config_init_version: '1.0.0',
    npm_package_devDependencies_clean_css: '3.4.6',
    npm_package_optionalDependencies_windows_mutex: '^0.2.0',
    XDG_VTNR: '7',
    npm_package_dependencies_keytar: '^4.0.5',
    npm_config_registry: 'https://registry.yarnpkg.com',
    npm_package_dependencies_node_pty: '0.7.3',
    npm_package_devDependencies_gulp_filter: '^3.0.0',
    SSH_AUTH_SOCK: '/tmp/ssh-ZjnlRjox84TH/agent.692',
    npm_package_devDependencies_flatpak_bundler: '^0.1.1',
    npm_package_devDependencies_coveralls: '^2.11.11',
    npm_package_devDependencies__types_minimist: '1.2.0',
    npm_package_main: './out/main',
    npm_config_strict_ssl: 'true',
    GLADE_CATALOG_PATH: ':',
    LC_NAME: 'fr_FR.UTF-8',
    XDG_SESSION_ID: 'c2',
    XDG_GREETER_DATA_DIR: '/var/lib/lightdm-data/user',
    npm_package_distro: '3ad4dcb7f51b672173c5009c1965bd448f65811f',
    USER: 'user',
    npm_package_license: 'MIT',
    GLADE_MODULE_PATH: ':',
    npm_package_scripts_postinstall: 'node build/npm/postinstall.js',
    DESKTOP_SESSION: 'xfce',
    npm_package_devDependencies_event_stream: '^3.1.7',
    npm_lifecycle_event: 'preinstall',
    npm_package_optionalDependencies_fsevents: '0.3.8',
    npm_package_devDependencies_gulp_image_resize: '^0.10.0',
    npm_package_scripts_gulp: 'gulp --max_old_space_size=4096',
    npm_package_description: '[![Build Status](https://travis-ci.org/Microsoft/vscode.svg?branch=master)](https://travis-ci.org/Microsoft/vscode) [![Build Status](https://ci.appveyor.com/api/projects/status/vuhlhg80tj3e2a0l/branch/master?svg=true)](https://ci.appveyor.com/project/VSCode/vscode) [![Coverage Status](https://img.shields.io/coveralls/Microsoft/vscode/master.svg)](https://coveralls.io/github/Microsoft/vscode?branch=master) [![Gitter](https://img.shields.io/badge/chat-on%20gitter-blue.svg)](https://gitter.im/Microsoft/vscode)',
    npm_package_dependencies_vscode_ripgrep: '0.6.0-patch.0.2',
    npm_package_dependencies_native_watchdog: '0.3.0',
    npm_package_devDependencies__types_keytar: '4.0.1',
    npm_package_devDependencies_gulp_remote_src: '^0.4.0',
    QT_QPA_PLATFORMTHEME: 'qt5ct',
    PWD: '/home/user/Documents/vscode',
    HOME: '/home/user',
    npm_package_devDependencies_gulp: '^3.8.9',
    SSH_AGENT_PID: '693',
    npm_package_devDependencies_gulp_flatmap: '^1.0.0',
    npm_package_devDependencies__types_semver: '5.3.30',
    npm_package_dependencies_chokidar: 'bpasero/chokidar#vscode',
    npm_package_scripts_monaco_editor_setup: 'node scripts/monaco-editor-setup.js',
    npm_config_argv: '{"remain":[],"cooked":["install"],"original":[]}',
    npm_package_dependencies_jschardet: '^1.5.1',
    npm_package_devDependencies_object_assign: '^4.0.1',
    npm_package_devDependencies_gulp_uglify: '^3.0.0',
    XDG_SESSION_TYPE: 'x11',
    npm_package_devDependencies_electron_mksnapshot: '~1.7.0',
    npm_package_devDependencies_azure_storage: '^0.3.1',
    npm_package_scripts_watch: 'gulp watch --max_old_space_size=4096',
    XDG_DATA_DIRS: '/usr/local/share:/usr/share',
    npm_package_devDependencies_gulp_tslint: '^7.0.1',
    npm_config_version_git_sign: '',
    npm_package_devDependencies_typescript_formatter: '4.0.1',
    npm_package_devDependencies_gulp_tsb: '2.0.4',
    npm_package_dependencies_fast_plist: '0.1.2',
    npm_package_devDependencies_gulp_util: '^3.0.6',
    npm_package_devDependencies_debounce: '^1.0.0',
    npm_package_devDependencies_gulp_mocha: '^2.1.3',
    npm_package_devDependencies_is: '^3.1.0',
    npm_package_scripts_test: 'mocha',
    npm_package_devDependencies_husky: '^0.13.1',
    XDG_SESSION_DESKTOP: 'xfce',
    npm_package_devDependencies_gulp_json_editor: '^2.2.1',
    npm_config_version_tag_prefix: 'v',
    npm_package_devDependencies_jsdom_no_contextify: '^3.1.0',
    LC_ADDRESS: 'fr_FR.UTF-8',
    npm_package_devDependencies_sinon: '^1.17.2',
    npm_package_devDependencies_typescript: '2.5.2',
    npm_package_devDependencies_mocha: '^2.2.5',
    npm_package_devDependencies_gulp_rename: '^1.2.0',
    LC_NUMERIC: 'fr_FR.UTF-8',
    npm_package_dependencies_minimist: '1.2.0',
    npm_package_bugs_url: 'https://github.com/Microsoft/vscode/issues',
    npm_package_devDependencies_underscore: '^1.8.2',
    npm_config_ignore_scripts: '',
    npm_package_devDependencies_gulp_replace: '^0.5.4',
    npm_package_devDependencies_gulp_sourcemaps: '^1.11.0',
    GLADE_PIXMAP_PATH: ':',
    npm_package_devDependencies_rimraf: '^2.2.8',
    GTK_MODULES: 'canberra-gtk-module:canberra-gtk-module',
    npm_package_dependencies_https_proxy_agent: '0.3.6',
    npm_package_scripts_7z: '7z',
    MAIL: '/var/spool/mail/user',
    npm_package_devDependencies_gulp_azure_storage: '^0.7.0',
    npm_package_scripts_monaco_editor_test: 'mocha --only-monaco-editor',
    npm_package_devDependencies_gulp_cssnano: '^2.1.0',
    npm_package_devDependencies_innosetup_compiler: '^5.5.60',
    npm_lifecycle_script: 'node build/npm/preinstall.js',
    VTE_VERSION: '5002',
    SHELL: '/bin/bash',
    TERM: 'xterm-256color',
    npm_package_devDependencies_tslint: '^4.3.1',
    N_PREFIX: '/home/user/n',
    XDG_SEAT_PATH: '/org/freedesktop/DisplayManager/Seat0',
    npm_package_devDependencies_gulp_vinyl_zip: '^1.2.2',
    npm_package_devDependencies_gulp_eslint: '^3.0.1',
    npm_package_devDependencies_vsce: '^1.25.1',
    XDG_CURRENT_DESKTOP: 'XFCE',
    npm_package_dependencies_yauzl: '2.8.0',
    npm_package_private: 'true',
    npm_package_devDependencies_uglify_es: '^3.0.18',
    npm_package_licenseText: '"MIT License\\n\\nCopyright (c) 2015 - present Microsoft Corporation\\n\\nAll rights reserved.\\n\\nPermission is hereby granted, free of charge, to any person obtaining a copy\\nof this software and associated documentation files (the \\"Software\\"), to deal\\nin the Software without restriction, including without limitation the rights\\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\\ncopies of the Software, and to permit persons to whom the Software is\\nfurnished to do so, subject to the following conditions:\\n\\nThe above copyright notice and this permission notice shall be included in all\\ncopies or substantial portions of the Software.\\n\\nTHE SOFTWARE IS PROVIDED \\"AS IS\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\\nSOFTWARE.\\n"',
    npm_package_dependencies_xterm: 'Tyriar/xterm.js#vscode-release/1.18',
    npm_package_optionalDependencies_windows_process_tree: '0.1.6',
    SHLVL: '3',
    XDG_SEAT: 'seat0',
    npm_package_devDependencies__types_sinon: '1.16.34',
    npm_node_execpath: '/home/user/n/bin/node',
    WINDOWID: '79691779',
    npm_package_devDependencies_queue: '3.0.6',
    LC_TELEPHONE: 'fr_FR.UTF-8',
    npm_package_author_name: 'Microsoft Corporation',
    npm_package_devDependencies_glob: '^5.0.13',
    npm_package_dependencies_vscode_debugprotocol: '1.24.0',
    npm_package_devDependencies_gulp_shell: '^0.5.2',
    npm_package_repository_type: 'git',
    GDMSESSION: 'xfce',
    npm_package_version: '1.18.1',
    LOGNAME: 'user',
    DBUS_SESSION_BUS_ADDRESS: 'unix:path=/run/user/1000/bus',
    XDG_RUNTIME_DIR: '/run/user/1000',
    XAUTHORITY: '/home/user/.Xauthority',
    npm_config_version_git_tag: 'true',
    npm_package_devDependencies_pump: '^1.0.1',
    npm_package_devDependencies_source_map: '^0.4.4',
    XDG_SESSION_PATH: '/org/freedesktop/DisplayManager/Session0',
    npm_package_devDependencies_gulp_concat: '^2.6.0',
    npm_package_dependencies_gc_signals: '^0.0.1',
    XDG_CONFIG_DIRS: '/etc/xdg',
    PATH: '/home/user/Documents/vscode/node_modules/.bin:/home/user/.config/yarn/link/node_modules/.bin:/home/user/Documents/vscode/node_modules/.bin:/home/user/.config/yarn/link/node_modules/.bin:/home/user/.yarn/bin:/home/user/n/lib/node_modules/npm/bin/node-gyp-bin:/home/user/n/bin/node_modules/npm/bin/node-gyp-bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/user/n/bin',
    npm_package_dependencies_applicationinsights: '0.17.1',
    npm_package_devDependencies_lazy_js: '^0.4.2',
    LC_IDENTIFICATION: 'fr_FR.UTF-8',
    npm_config_save_prefix: '^',
    npm_package_devDependencies_mkdirp: '^0.5.0',
    npm_package_devDependencies_gulp_atom_electron: '^1.11.0',
    npm_config_ignore_optional: '',
    npm_package_devDependencies_mime: '1.2.11',
    npm_package_scripts_precommit: 'node build/gulpfile.hygiene.js',
    npm_package_devDependencies_vinyl_fs: '^2.4.3',
    NODE: '/home/user/n/bin/node',
    npm_package_readmeFilename: 'README.md',
    SESSION_MANAGER: 'local/ma-user:@/tmp/.ICE-unix/686,unix/ma-user:/tmp/.ICE-unix/686',
    npm_package_name: 'code-oss-dev',
    npm_package_devDependencies_minimatch: '^2.0.10',
    npm_package_devDependencies_7zip: '0.0.6',
    npm_package_dependencies_native_keymap: '1.2.5',
    npm_package_devDependencies_optimist: '0.3.5',
    npm_package_dependencies_nsfw: '1.0.16',
    npm_package_devDependencies_remap_istanbul: '^0.6.4',
    npm_package_dependencies_http_proxy_agent: '0.2.7',
    LC_TIME: 'fr_FR.UTF-8'
}

(Only edit I made is replacing my real username by user).

And again:

npm_execpath: '/home/user/n/lib/node_modules/yarn/bin/yarn.js'

joaomoreno commented 6 years ago

This message tells me you don't have our latest sources:

You can't use plain npm to install Code's dependencies.
Please run './scripts/npm.sh install' instead.

Those messages are long gone since the Yarn adoption.