yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.73k forks source link

Won't finish yarn install without errors, npm works fine (Windows 10) #4516

Open yanok1 opened 7 years ago

yanok1 commented 7 years ago

I have a project using Ionic 3, and developed it with npm, my colleague started using yarn in Linux without problem and recommended me to start using Yarn.

But I can't pass the first yarn install in windows 10, it always guive me this error even with python installed.

[3/4] Linking dependencies...
warning "superagent-proxy@1.0.2" has incorrect peer dependency "superagent@>= 0.15.4 || 1 || 2 || 3".
warning "@ionic/app-scripts@1.3.7" has incorrect peer dependency "@angular/tsc-wrapped@*".
warning "ajv-keywords@1.5.1" has incorrect peer dependency "ajv@>=4.10.0".
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\.npmignore shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\bin shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\global.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\LICENSE shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\MAINTAINERS shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\make.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\package.json shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\README.md shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\scripts shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\shell.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\bin\shjs shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\scripts\generate-docs.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\scripts\run-tests.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\cat.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\cd.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\chmod.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\common.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\cp.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\dirs.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\echo.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\error.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\exec.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\find.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\grep.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\ln.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\ls.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\mkdir.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\mv.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\popd.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\pushd.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\pwd.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\rm.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\sed.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\set.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\tempdir.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\test.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\to.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\toEnd.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\touch.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\which.js shouldn't be copied twice in one bulk copy
[4/4] Building fresh packages...
[1/2] ⠄ leveldown: begin Prebuild version 4.5.0
[2/2] ⠄ node-sass: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.0/win32-x64-48_binding.node
[-/2] ⠄ waiting...
[-/2] ⠄ waiting...
error C:\nfe2\nota_fiscal_eletronica\node_modules\leveldown: Command failed.
Exit code: 2
Command: prebuild --install
Arguments:
Directory: C:\nfe2\nota_fiscal_eletronica\node_modules\leveldown
Output:
prebuild info begin Prebuild version 4.5.0
prebuild ERR! configure error
prebuild ERR! stack Error: Can't find Python executable "C:\Users\Carlos\AppData\Local\Programs\Python\Python36\python.exe", you can set the PYTHON env variable.
prebuild ERR! stack     at Object.failNoPython (C:\nfe2\nota_fiscal_eletronica\node_modules\node-gyp\lib\configure.js:483:19)
prebuild ERR! stack     at Object.<anonymous> (C:\nfe2\nota_fiscal_eletronica\node_modules\node-gyp\lib\configure.js:508:16)
prebuild ERR! stack     at C:\nfe2\nota_fiscal_eletronica\node_modules\graceful-fs\polyfills.js:284:29
prebuild ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)
prebuild ERR! not ok
prebuild ERR! build Error: Can't find Python executable "C:\Users\Carlos\AppData\Local\Programs\Python\Python36\python.exe", you can set the PYTHON env variable.
prebuild ERR! build     at Object.failNoPython (C:\nfe2\nota_fiscal_eletronica\node_modules\node-gyp\lib\configure.js:483:19)

I m using:

Node - v6.11.3 windows 10 creators edition yarn 1.0.2

olingern commented 7 years ago

@yanok1 can you post your package.json? This could make things easier to diagnose

kuncevic commented 7 years ago

I have same thing happening, so just ending up of copying the node-sass folder from another project.

Here is my package.json dependency

"dependencies": {
    "@angular/animations": "4.4.1",
    "@angular/cdk": "^2.0.0-beta.10",
    "@angular/common": "4.4.1",
    "@angular/compiler": "4.4.1",
    "@angular/core": "4.4.1",
    "@angular/flex-layout": "^2.0.0-beta.9",
    "@angular/forms": "4.4.1",
    "@angular/http": "4.4.1",
    "@angular/material": "^2.0.0-beta.10",
    "@angular/platform-browser": "4.4.1",
    "@angular/platform-browser-dynamic": "4.4.1",
    "@angular/router": "4.4.1",
    "@ngrx/core": "^1.2.0",
    "@ngrx/effects": "^4.0.5",
    "@ngrx/router-store": "^4.0.4",
    "@ngrx/store": "^4.0.3",
    "@ngrx/store-devtools": "^4.0.0",
    "@swimlane/ngx-datatable": "7.3.0",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.4.1",
    "hammerjs": "2.0.8",
    "intl": "^1.2.5",
    "lodash-es": "^4.17.4",
    "material-design-icons": "3.0.1",
    "moment-mini": "^2.18.1",
    "ngrx-store-freeze": "^0.1.9",
    "powerbi-client": "2.3.5",
    "oidc-client": "^1.3.0",
    "rxjs": "^5.4.3",
    "uuid": "^3.1.0",
    "web-animations-js": "^2.2.5",
    "whatwg-fetch": "^2.0.3",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "^1.4.2",
    "@angular/compiler-cli": "4.4.1",
    "@swimlane/ngx-datatable": "^7.3.0",
    "@types/d3": "^4.5.0",
    "@types/google.analytics": "^0.0.34",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/lodash-es": "^4.14.5",
    "@types/node": "~6.0.60",
    "@types/uuid": "^3.4.0",
    "codelyzer": "~3.1.1",
    "husky": "^0.13.3",
    "jasmine-core": "^2.8.0",
    "jasmine-spec-reporter": "^4.2.1",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "sass-lint": "^1.11.1",
    "ts-node": "~3.2.0",
    "tslint": "~5.3.2",
    "typescript": "^2.4.2",
    "webpack-bundle-analyzer": "^2.8.3"
  }

and the error is:

Error running install script for optional dependency: "c:\\Projects\\work\\Source\\node_modules\\node-sass: 
Command failed.\nExit code: 1\nCommand: node scripts/build.js\nArguments: \nDirectory: 
c:\\Projects\\work\\Source\\node_modules\\node-sass\nOutput:\nBuilding: C:\\Program 
Files\\nodejs\\node.exe c:\\Projects\\work\\Source\\node_modules\\node-gyp\\bin\\node-gyp.js 
rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=\ngyp 
info it worked if it ends with ok\ngyp verb cli [ 'C:\\\\Program Files\\\\nodejs\\\\node.exe',\ngyp 
verb cli   'c:\\\\Projects\\\\work\\\\\\Source\\\\node_modules\\\\node-gyp\\\\bin\\\\node-gyp.js',\ngyp 
verb cli   'rebuild',\ngyp verb cli   '--verbose',\ngyp verb cli   '--libsass_ext=',\ngyp 
verb cli   '--libsass_cflags=',\ngyp verb cli   '--libsass_ldflags=',\ngyp verb 
cli   '--libsass_library=' ]\ngyp info using node-gyp@3.6.0\ngyp info using node@8.4.0 
| win32 | x64\ngyp verb command rebuild []\ngyp verb command clean []\ngyp verb 
clean removing \"build\" directory\ngyp verb command configure []\ngyp verb check 
python checking for Python executable \"python2\" in the PATH\ngyp verb `which` 
failed Error: not found: python2\ngyp verb `which` failed     at getNotFoundError 
(c:\\Projects\\work\\Source\\node_modules\\which\\which.js:13:12)\ngyp verb `which` 
failed     at F (c:\\Projects\\work\\Source\\node_modules\\which\\which.js:68:19)\ngyp 
verb `which` failed     at E (c:\\Projects\\work\\Source\\node_modules\\which\\which.js:80:29)\ngyp 
verb `which` failed     at c:\\Projects\\work\\Source\\node_modules\\which\\which.js:89:16\ngyp 
verb `which` failed     at c:\\Projects\\work\\Source\\node_modules\\isexe\\index.js:42:5\ngyp 
verb `which` failed     at c:\\Projects\\work\\Source\\node_modules\\isexe\\windows.js:36:5\ngyp 
verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)\ngyp verb `which` 
failed  python2 { Error: not found: python2\ngyp verb `which` failed     at getNotFoundError 
(c:\\Projects\\work\\Source\\node_modules\\which\\which.js:13:12)\ngyp verb `which` 
failed     at F (c:\\Projects\\work\\Source\\node_modules\\which\\which.js:68:19)\ngyp 
verb `which` failed     at E (c:\\Projects\\work\\Source\\node_modules\\which\\which.js:80:29)\ngyp 
verb `which` failed     at c:\\Projects\\work\\Source\\node_modules\\which\\which.js:89:16\ngyp 
verb `which` failed     at c:\\Projects\\work\\Source\\node_modules\\isexe\\index.js:42:5\ngyp 
verb `which` failed     at c:\\Projects\\work\\Source\\node_modules\\isexe\\windows.js:36:5\ngyp 
verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21) code: 'ENOENT' }\ngyp 
verb check python checking for Python executable \"python\" in the PATH\ngyp verb 
`which` succeeded python C:\\tools\\Python27\\python.EXE\ngyp verb check python 
version `C:\\tools\\Python27\\python.EXE -c \"import platform; print(platform.python_version());\"` 
returned: \"2.7.13\\r\\n\"\ngyp verb get node dir no --target version specified, 
falling back to host node version: 8.4.0\ngyp verb command install [ '8.4.0' ]\ngyp 
verb install input version string \"8.4.0\"\ngyp verb install installing version: 
8.4.0\ngyp verb install --ensure was passed, so won't reinstall if already installed\ngyp 
verb install version is already installed, need to check \"installVersion\"\ngyp 
verb got \"installVersion\" 9\ngyp verb needs \"installVersion\" 9\ngyp verb install 
version is good\ngyp verb get node dir target node version installed: 8.4.0\ngyp 
verb build dir attempting to create \"build\" dir: c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\ngyp 
verb build dir \"build\" dir needed to be created? c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\ngyp 
verb Not using VS2017: Could not use PowerShell to find VS2017\ngyp verb build/config.gypi 
creating config file\ngyp verb build/config.gypi writing out config file: c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\config.gypi\ngyp 
verb config.gypi checking for gypi file: c:\\Projects\\work\\Source\\node_modules\\node-sass\\config.gypi\ngyp 
verb common.gypi checking for gypi file: c:\\Projects\\work\\Source\\node_modules\\node-sass\\common.gypi\ngyp 
verb gyp gyp format was not specified; forcing \"msvs\"\ngyp info spawn C:\\tools\\Python27\\python.EXE\ngyp 
info spawn args [ 'c:\\\\Projects\\\\work\\\\\\Source\\\\node_modules\\\\node-gyp\\\\gyp\\\\gyp_main.py',\ngyp 
info spawn args   'binding.gyp',\ngyp info spawn args   '-f',\ngyp info spawn args 
  'msvs',\ngyp info spawn args   '-G',\ngyp info spawn args   'msvs_version=auto',\ngyp 
info spawn args   '-I',\ngyp info spawn args   'c:\\\\Projects\\\\work\\\\\\Source\\\\node_modules\\\\node-sass\\\\build\\\\config.gypi',\ngyp 
info spawn args   '-I',\ngyp info spawn args   'c:\\\\Projects\\\\work\\\\\\Source\\\\node_modules\\\\node-gyp\\\\addon.gypi',\ngyp 
info spawn args   '-I',\ngyp info spawn args   'C:\\\\Users\\\\aak\\\\.node-gyp\\\\8.4.0\\\\include\\\\node\\\\common.gypi',\ngyp 
info spawn args   '-Dlibrary=shared_library',\ngyp info spawn args   '-Dvisibility=default',\ngyp 
info spawn args   '-Dnode_root_dir=C:\\\\Users\\\\aak\\\\.node-gyp\\\\8.4.0',\ngyp 
info spawn args   '-Dnode_gyp_dir=c:\\\\Projects\\\\work\\\\\\Source\\\\node_modules\\\\node-gyp',\ngyp 
info spawn args   '-Dnode_lib_file=node.lib',\ngyp info spawn args   '-Dmodule_root_dir=c:\\\\Projects\\\\work\\\\\\Source\\\\node_modules\\\\node-sass',\ngyp 
info spawn args   '-Dnode_engine=v8',\ngyp info spawn args   '--depth=.',\ngyp info 
spawn args   '--no-parallel',\ngyp info spawn args   '--generator-output',\ngyp 
info spawn args   'c:\\\\Projects\\\\work\\\\\\Source\\\\node_modules\\\\node-sass\\\\build',\ngyp 
info spawn args   '-Goutput_dir=.' ]\ngyp verb command build []\ngyp verb build 
type Release\ngyp verb architecture x64\ngyp verb node dev dir C:\\Users\\aak\\.node-gyp\\8.4.0\ngyp 
verb found first Solution file build/binding.sln\ngyp verb could not find \"msbuild.exe\" 
in PATH - finding location in registry \ngyp verb \"Release\" dir needed to be created? 
null\ngyp verb copying \"node.lib\" for x64 C:\\Users\\aak\\.node-gyp\\8.4.0\\Release\\node.lib\ngyp 
info spawn C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe\ngyp info 
spawn args [ 'build/binding.sln',\ngyp info spawn args   '/nologo',\ngyp info spawn 
args
   '/p:Configuration=Release;Platform=x64' ]\nBuilding the projects in this solution 
one at a time. To enable parallel build, please add the \"/m\" switch.\r\nBuild 
started 09/22/2017 14:09:17.\r\nProject \"c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\binding.sln\" 
on node 1 (default targets).\r\nValidateSolutionConfiguration:\r\n  Building solution 
configuration \"Release|x64\".\r\nProject \"c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\binding.sln\" 
(1) is building \"c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\binding.vcxproj.metaproj\" 
(2) on node 1 (default targets).\r\nProject \"c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\binding.vcxproj.metaproj\" 
(2) is building \"c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\src\\libsass.vcxproj\" 
(3) on node 1 (default targets).\r\nc:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\src\\libsass.vcxproj(20,3): 
error MSB4019: The imported project \"c:\\Microsoft.Cpp.Default.props\" was not 
found. Confirm that the path in the <Import> declaration is correct, and that the 
file exists on disk.\r\nDone Building Project \"c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\src\\libsass.vcxproj\" 
(default targets) -- FAILED.\r\nDone Building Project \"c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\binding.vcxproj.metaproj\" 
(default targets) -- FAILED.\r\nDone Building Project \"c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\binding.sln\" 
(default targets) -- FAILED.\r\n\r\nBuild FAILED.\r\n\r\n\"c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\binding.sln\" 
(default target) (1) ->\r\n\"c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\binding.vcxproj.metaproj\" 
(default target) (2) ->\r\n\"c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\src\\libsass.vcxproj\" 
(default target) (3) ->\r\n  c:\\Projects\\work\\Source\\node_modules\\node-sass\\build\\src\\libsass.vcxproj(20,3): 
error MSB4019: The imported project \"c:\\Microsoft.Cpp.Default.props\" was not 
found. Confirm that the path in the <Import> declaration is correct, and that the 
file exists on disk.\r\n\r\n    0 Warning(s)\r\n    1 Error(s)\r\n\r\nTime Elapsed 
00:00:00.21\r\ngyp ERR! build error \ngyp ERR! stack Error: `C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe` 
failed with exit code: 1\ngyp ERR! stack     at ChildProcess.onExit (c:\\Projects\\work\\Source\\node_modules\\node-gyp\\lib\\build.js:285:23)\ngyp 
ERR! stack     at emitTwo (events.js:125:13)\ngyp ERR! stack     at ChildProcess.emit 
(events.js:213:7)\ngyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)\ngyp 
ERR! System Windows_NT 6.1.7601\ngyp ERR! command \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" 
\"c:\\\\Projects\\\\work\\\\\\Source\\\\node_modules\\\\node-gyp\\\\bin\\\\node-gyp.js\" 
\"rebuildsuccess Saved lockfile.

node 8.4 (have node 8.5 on another PC that has same error) yarn 1.0.2 and yeah, npm works just fine.

yanok1 commented 7 years ago

Sure @olingern, my package.json:

{
    "name": "nota_fiscal_eletronica",
    "version": "0.1.0",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "4.1.3",
        "@angular/compiler": "4.1.3",
        "@angular/compiler-cli": "4.1.3",
        "@angular/core": "4.1.3",
        "@angular/forms": "4.1.3",
        "@angular/http": "4.1.3",
        "@angular/platform-browser": "4.1.3",
        "@angular/platform-browser-dynamic": "4.1.3",
        "@ionic-native/barcode-scanner": "^4.1.0",
        "@ionic-native/core": "3.10.2",
        "@ionic-native/file": "^4.2.0",
        "@ionic-native/google-analytics": "^4.1.0",
        "@ionic-native/google-plus": "^4.2.1",
        "@ionic-native/social-sharing": "^4.2.1",
        "@ionic-native/splash-screen": "3.10.2",
        "@ionic-native/status-bar": "3.10.2",
        "@ionic/cli-plugin-proxy": "^1.4.1",
        "@ionic/storage": "2.0.1",
        "cordova-android": "^6.2.3",
        "cordova-browser": "^4.1.0",
        "cordova-plugin-compat": "^1.0.0",
        "cordova-plugin-console": "^1.0.7",
        "cordova-plugin-device": "^1.1.6",
        "cordova-plugin-file": "^4.3.3",
        "cordova-plugin-google-analytics": "^1.8.3",
        "cordova-plugin-googleplus": "^5.1.1",
        "cordova-plugin-inappbrowser": "^1.7.1",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.3",
        "cordova-plugin-whitelist": "^1.3.2",
        "cordova-plugin-x-socialsharing": "^5.2.0",
        "cordova-sqlite-storage": "^2.0.4",
        "es6-promise-plugin": "^4.1.0",
        "ionic-angular": "3.4.2",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "list": "^1.0.0",
        "moment": "^2.18.1",
        "nfe-downloader": "^0.2.2",
        "phonegap-plugin-barcodescanner": "^6.0.8",
        "pouchdb": "^6.3.4",
        "pouchdb-find": "^6.3.4",
        "rxjs": "5.4.0",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.12"
    },
    "devDependencies": {
        "@ionic/app-scripts": "1.3.7",
        "ionic": "3.9.2",
        "typescript": "2.3.3"
    },
    "description": "An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "phonegap-plugin-barcodescanner": {},
            "cordova-plugin-inappbrowser": {},
            "cordova-plugin-google-analytics": {},
            "cordova-plugin-file": {},
            "cordova-sqlite-storage": {},
            "cordova-plugin-x-socialsharing": {},
            "cordova-plugin-googleplus": {
                "REVERSED_CLIENT_ID": "**REVERSED_CLIENT_ID**"
            }
        },
        "platforms": [
            "android",
            "browser"
        ]
    }
}
BYK commented 7 years ago

I was unable to reproduce this locally on Windows 10 with the latest nightly. Can you try with the nightly to see if it is resolved for you too: https://yarnpkg.com/en/docs/nightly

yanok1 commented 7 years ago

@BYK here is the output from nightly version:

yarn install v1.1.0-20170922.1940
info No lockfile found.
[1/4] Resolving packages...
warning babili@0.0.10: babili has been renamed to babel-minify. Please update to babel-minify
warning babel-preset-babili@0.0.10: babili has been renamed to babel-minify. Please update to babel-preset-minify
warning object-keys@0.4.0:
warning object-keys@0.2.0: Please update to the latest object-keys
[2/4] Fetching packages...
info fsevents@1.1.2: The platform "win32" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "superagent-proxy@1.0.2" has unmet peer dependency "superagent@>= 0.15.4 || 1 || 2 || 3".
warning "@ionic/app-scripts@1.3.7" has unmet peer dependency "@angular/tsc-wrapped@*".
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\.npmignore shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\bin shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\global.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\LICENSE shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\MAINTAINERS shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\make.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\package.json shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\README.md shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\scripts shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\shell.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\bin\shjs shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\scripts\generate-docs.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\scripts\run-tests.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\cat.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\cd.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\chmod.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\common.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\cp.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\dirs.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\echo.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\error.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\exec.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\find.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\grep.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\ln.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\ls.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\mkdir.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\mv.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\popd.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\pushd.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\pwd.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\rm.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\sed.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\set.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\tempdir.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\test.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\to.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\toEnd.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\touch.js shouldn't be copied twice in one bulk copy
warning The case-insensitive file C:\nfe2\nota_fiscal_eletronica\node_modules\cordova-browser\node_modules\shelljs\src\which.js shouldn't be copied twice in one bulk copy
[4/4] Building fresh packages...
[1/2] ⠂ leveldown: Prebuild version 4.5.0
[2/2] ⠂ node-sass: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.0/win32-x64-48_binding.node
[-/2] ⠂ waiting...
[-/2] ⠂ waiting...
error C:\nfe2\nota_fiscal_eletronica\node_modules\leveldown: Command failed.
Exit code: 2
Command: prebuild --install
Arguments:
Directory: C:\nfe2\nota_fiscal_eletronica\node_modules\leveldown
Output:
prebuild info begin Prebuild version 4.5.0
prebuild ERR! configure error
prebuild ERR! stack Error: Can't find Python executable "C:\Users\Carlos\AppData\Local\Programs\Python\Python36\python.exe", you can set the PYTHON env variable.
prebuild ERR! stack     at Object.failNoPython (C:\nfe2\nota_fiscal_eletronica\node_modules\node-gyp\lib\configure.js:483:19)
prebuild ERR! stack     at Object.<anonymous> (C:\nfe2\nota_fiscal_eletronica\node_modules\node-gyp\lib\configure.js:508:16)
prebuild ERR! stack     at C:\nfe2\nota_fiscal_eletronica\node_modules\graceful-fs\polyfills.js:284:29
prebuild ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)
prebuild ERR! not ok
prebuild ERR! build Error: Can't find Python executable "C:\Users\Carlos\AppData\Local\Programs\Python\Python36\python.exe", you can set the PYTHON env variable.
prebuild ERR! build     at Object.failNoPython (C:\nfe2\nota_fiscal_eletronica\node_modules\node-gyp\lib\configure.js:483:19)

Still the same issue.

kuncevic commented 7 years ago

@BYK, @yanok1, in order to get it working now I had to run npm rebuild node-sass after yarn install https://github.com/sass/node-sass/issues/1579#issuecomment-306585762 and that is exactly what npm install always does automatically as postinstall thing:

c:\Projects\work\Source>npm rebuild node-sass

> node-sass@4.5.3 install c:\Projects\work\Source\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Users\ak\AppData\Roaming\npm-cache\node-sass\4.5.3\win32-x64-57_binding.node

> node-sass@4.5.3 postinstall c:\Projects\work\Source\node_modules\node-sass
> node scripts/build.js

Binary found at c:\Projects\work\Source\node_modules\node-sass\vendor\win32-x64-57\binding.node Testing binary
Binary is fine
node-sass@4.5.3 c:\Projects\work\Source\node_modules\node-sass
yanok1 commented 7 years ago

@kuncevic really apretiate your attention. If you dont mind I have a few questions, should I run npm rebuild node-sass everytime after yarn install? How does that affect it and how does it avoid me to have to wait a full cicle of yarn install (since the first run does do extra load and take longer)? Does that feature impact in other packages?

kuncevic commented 7 years ago

you have to run npm rebuild node-sass every time when yarn throwing an error as above. What it does is just compiling node-sass, that is it. Hopefully it will be fixed soon.

BYK commented 7 years ago

@kuncevic I don't think that was the problem @yanok1 was experiencing. It explicitly says " Can't find Python executable "C:\Users\Carlos\AppData\Local\Programs\Python\Python36\python.exe", you can set the PYTHON env variable." in the prebuild command output there.

kuncevic commented 7 years ago

@BYK before I installed the Python on my machine I had similar error yarn complaining that Python is missing. Just removed the Python from the path and here it is:

4/4] Building fresh packages...
[1/1] ⠁ node-sass: could not find "python". checking python launcher
[-/1] ⠁ waiting...
[-/1] ⠁ waiting...
[-/1] ⠁ waiting...
warning Error running install script for optional dependency: "C:\\Projects\\work\\Source\\node_modules\\node-sass: 
Command failed.\nExit code: 1\nCommand: node s
cripts/build.js\nArguments: \nDirectory: C:\\Projects\\work\\Source\\node_modules\\node-sass\nOutput:\nBuilding: 
C:\\Program Files\\nodejs\\node.exe C:\\Projects\
\work\\Source\\node_modules\\node-gyp\\bin\\node-gyp.js rebuild 
--verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=\ngyp 
info it work
ed if it ends with ok\ngyp verb cli [ 'C:\\\\Program Files\\\\nodejs\\\\node.exe',\ngyp 
verb cli   'C:\\\\Projects\\\\work\\\\Source\\\\node_modules\\\\node-gyp
\\\\bin\\\\node-gyp.js',\ngyp verb cli   'rebuild',\ngyp verb cli   '--verbose',\ngyp 
verb cli   '--libsass_ext=',\ngyp verb cli   '--libsass_cflags=',\ngyp verb cli 
  '--libsass_ld
flags=',\ngyp verb cli   '--libsass_library=' ]\ngyp info using node-gyp@3.6.0\ngyp 
info using node@8.5.0 | win32 | x64\ngyp verb command rebuild []\ngyp verb command 
clean []\ngyp
verb clean removing \"build\" directory\ngyp verb command configure []\ngyp verb 
check python checking for Python executable \"python2\" in the PATH\ngyp verb `which` 
failed Error:
not found: python2\ngyp verb `which` failed     at getNotFoundError (C:\\Projects\\work\\Source\\node_modules\\which\\which.js:13:12)\ngyp 
verb `which` failed
 at F (C:\\Projects\\work\\Source\\node_modules\\which\\which.js:68:19)\ngyp 
verb `which` failed     at E (C:\\Projects\\work\\Source\\node_mod
ules\\which\\which.js:80:29)\ngyp verb `which` failed     at C:\\Projects\\work\\Source\\node_modules\\which\\which.js:89:16\ngyp 
verb `which` failed     at C:\\P
rojects\\work\\Source\\node_modules\\isexe\\index.js:42:5\ngyp 
verb `which` failed     at C:\\Projects\\work\\Source\\node_modules\\isexe\\wind
ows.js:36:5\ngyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:153:21)\ngyp 
verb `which` failed  python2 { Error: not found: python2\ngyp verb `which` failed 
    at getNotF
oundError (C:\\Projects\\work\\\\Source\\node_modules\\which\\which.js:13:12)\ngyp 
verb `which` failed     at F (C:\\Projects\\work\\Source\\node
_modules\\which\\which.js:68:19)\ngyp verb `which` failed     at E (C:\\Projects\\work\\Source\\node_modules\\which\\which.js:80:29)\ngyp 
verb `which` failed
at C:\\Projects\\work\\Source\\node_modules\\which\\which.js:89:16\ngyp 
verb `which` failed     at C:\\Projects\\work\\Source\\node_modules\\is
exe\\index.js:42:5\ngyp verb `which` failed     at C:\\Projects\\work\\Source\\node_modules\\isexe\\windows.js:36:5\ngyp 
verb `which` failed     at FSReqWrap.onco
mplete (fs.js:153:21) code: 'ENOENT' }\ngyp verb check python checking for Python 
executable \"python\" in the PATH\ngyp verb `which` failed Error: not found: python\ngyp 
verb `whic
h` failed     at getNotFoundError (C:\\Projects\\work\\Source\\node_modules\\which\\which.js:13:12)\ngyp 
verb `which` failed     at F (C:\\Projects\\work\\Corum.S
apphire.UI\\Source\\node_modules\\which\\which.js:68:19)\ngyp verb `which` failed 
    at E (C:\\Projects\\work\\Source\\node_modules\\which\\which.js:80:29)\ngyp
verb `which` failed     at C:\\Projects\\work\\Source\\node_modules\\which\\which.js:89:16\ngyp 
verb `which` failed     at C:\\Projects\\work\\
Source\\node_modules\\isexe\\index.js:42:5\ngyp verb `which` failed     at C:\\Projects\\work\\Source\\node_modules\\isexe\\windows.js:36:5\ngyp 
verb `which` fail
ed     at FSReqWrap.oncomplete (fs.js:153:21)\ngyp verb `which` failed  python { 
Error: not found: python\ngyp verb `which` failed     at getNotFoundError (C:\\Projects\\work\\Corum
.Sapphire.UI\\Source\\node_modules\\which\\which.js:13:12)\ngyp verb `which` failed 
    at F (C:\\Projects\\work\\Source\\node_modules\\which\\which.js:68:19)\ngy
p verb `which` failed     at E (C:\\Projects\\work\\Source\\node_modules\\which\\which.js:80:29)\ngyp 
verb `which` failed     at C:\\Projects\\work\\Corum.Sapphir
e.UI\\Source\\node_modules\\which\\which.js:89:16\ngyp verb `which` failed     at 
C:\\Projects\\work\\Source\\node_modules\\isexe\\index.js:42:5\ngyp 
verb `which`
 failed     at C:\\Projects\\work\\Source\\node_modules\\isexe\\windows.js:36:5\ngyp 
verb `which` failed     at FSReqWrap.oncomplete (fs.js:153:21) code: 'ENOENT'
 }\ngyp verb could not find \"python\". checking python launcher \ngyp verb could 
not find \"python\". guessing location \ngyp verb ensuring that file exists: C:\\Python27\\python.e
xe\ngyp ERR! configure error \ngyp ERR! stack Error: Can't find Python executable 
\"python\", you can set the PYTHON env variable.\ngyp ERR! stack     at PythonFinder.failNoPython 
(
C:\\Projects\\work\\Source\\node_modules\\node-gyp\\lib\\configure.js:482:19)\ngyp 
ERR! stack     at PythonFinder.<anonymous> (C:\\Projects\\work\\Corum.Sapphire.
UI\\Source\\node_modules\\node-gyp\\lib\\configure.js:508:16)\ngyp ERR! stack   
  at C:\\Projects\\work\\Source\\node_modules\\graceful-fs\\polyfills.js:284:29\ng
yp ERR! stack     at FSReqWrap.oncomplete (fs.js:153:21)\ngyp ERR! System Windows_NT 
6.1.7601\ngyp ERR! command \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" \"C:\\\\Projects\\\\wor
success Saved 1 new dependency.

So having Python installed is not really helps and from another hand if I use npm it is just does not care about Python at all when installing node-sass.

UPDATE: just realized that in my another project that using node-sass I do not get any errors when yarn install may be there is some npm module that breaking things up....

ckee83 commented 6 years ago

I'm having the same issue when installing dependencies via yarn on a node 6.12 alpine container.

[3/4] Linking dependencies...
[4/4] Building fresh packages...
error /usr/src/app/node_modules/leveldown: Command failed.
Exit code: 2
Command: prebuild --install
Arguments: 
Directory: /usr/src/app/node_modules/leveldown
Output:
prebuild info begin Prebuild version 4.5.0
prebuild ERR! configure error 
prebuild ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
prebuild ERR! stack     at Object.failNoPython (/usr/src/app/node_modules/node-gyp/lib/configure.js:483:19)
prebuild ERR! stack     at Object.<anonymous> (/usr/src/app/node_modules/node-gyp/lib/configure.js:397:16)
prebuild ERR! stack     at F (/usr/src/app/node_modules/which/which.js:68:16)
prebuild ERR! stack     at E (/usr/src/app/node_modules/which/which.js:80:29)
prebuild ERR! stack     at /usr/src/app/node_modules/which/which.js:89:16
prebuild ERR! stack     at /usr/src/app/node_modules/isexe/index.js:42:5
prebuild ERR! stack     at /usr/src/app/node_modules/isexe/mode.js:8:5
prebuild ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)
prebuild ERR! not ok 
prebuild ERR! build Error: Can't find Python executable "python", you can set the PYTHON env variable.
prebuild ERR! build     at Object.failNoPython (/usr/src/app/node_modules/node-gyp/lib/configure.js:483:19)
prebuild ERR! build     at Object.<anonymous> (/usr/src/app/node_modules/node-gyp/lib/configure.js:397:16)
prebuild ERR! build     at F (/usr/src/app/node_modules/which/which.js:68:16)
prebuild ERR! build     at E (/usr/src/app/node_modules/which/which.js:80:29)
prebuild ERR! build     at /usr/src/app/node_modules/which/which.js:89:16
prebuild ERR! build     at /usr/src/app/node_modules/isexe/index.js:42:5
prebuild ERR! build     at /usr/src/app/node_modules/isexe/mode.js:8:5
prebuild ERR! build     at FSReqWrap.oncomplete (fs.js:123:15)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
BYK commented 6 years ago

@ckee83 do you have a Dockerfile that we can reproduce the issue?

olingern commented 6 years ago

@BYK A little digging on this.

Seems things are getting hung up on Windows here

~Looking at the leveldown package, I'm wondering if Yarn, for some reason, doesn't catch this prebuild step on Windows~

~> When installing leveldown, prebuild-install will install prebuilt binaries from GitHub if they exist and fallback to a compile step if they don't. In that case you'll need a valid node-gyp installation.~

So, after poking around in npm and node-gyp it seems that there's PYTHONPATHenv var in node-gyp that seems to be getting lost.

I wonder if, for some reason, this bit of code is tripping us up on some Windows machines:

// make sure python uses files that came with this particular node package
var pypath = [path.join(__dirname, '..', 'gyp', 'pylib')]
if (process.env.PYTHONPATH) {
    pypath.push(process.env.PYTHONPATH)
}
process.env.PYTHONPATH = pypath.join(win ? ';' : ':')

cc: @arcanis @bestander on thoughts here

zuekegreen commented 6 years ago

I have the same problem , when i starting to create new project in Ionic 3 , i got this error..

`> npm i × Running command - failed! [ERROR]

    > node-sass@4.5.3 install C:\Appbrowser\blank\node_modules\node-sass
    > node scripts/install.js

    Cached binary found at C:\Users\rylai\AppData\Roaming\npm-cache\node-sass\4.5.3\win32-x64-48_binding.node

    > uglifyjs-webpack-plugin@0.4.6 postinstall C:\Appbrowser\blank\node_modules\uglifyjs-webpack-plugin
    > node lib/post_install.js

    > node-sass@4.5.3 postinstall C:\Appbrowser\blank\node_modules\node-sass
    > node scripts/build.js

    Binary found at C:\Appbrowser\blank\node_modules\node-sass\vendor\win32-x64-48\binding.node
    Testing binary
    Binary is fine
    npm ERR! path C:\Appbrowser\blank\node_modules\fsevents\node_modules
    npm ERR! code EPERM
    npm ERR! errno -4048
    npm ERR! syscall scandir
    npm ERR! Error: EPERM: operation not permitted, scandir 'C:\Appbrowser\blank\node_modules\fsevents\node_modules'
    npm ERR!     at Error (native)
    npm ERR!  { Error: EPERM: operation not permitted, scandir
    'C:\Appbrowser\blank\node_modules\fsevents\node_modules'
    npm ERR!     at Error (native)
    npm ERR!   stack: 'Error: EPERM: operation not permitted, scandir
    \'C:\\Appbrowser\\blank\\node_modules\\fsevents\\node_modules\'\n    at Error (native)',
    npm ERR!   errno: -4048,
    npm ERR!   code: 'EPERM',
    npm ERR!   syscall: 'scandir',
    npm ERR!   path: 'C:\\Appbrowser\\blank\\node_modules\\fsevents\\node_modules' }
    npm ERR!
    npm ERR! Please try running this command again as root/Administrator.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\rylai\AppData\Roaming\npm-cache\_logs\2018-01-09T17_17_00_848Z-debug.log`

How can i solve this ? This is so really annoying..

EmaGht commented 6 years ago

The problem is not what you guys think it is... When installing node_sass, yarn or npm tries to resolve the precooked binaries from node_sass's GitHub repository, if it doesn't find them it just tries to compile them locally, which requires python. The problem isn't you guys don't have python, it's that you are checking for binaries that doesn't exist.

Double check your node version and make sure there are binaries available for it. Depending on your node version you need to install a different version of node_sass

cary-smith commented 6 years ago

@EmaGht Although that may be involved in some way, I am curious why I can run npm rebuild node-sass without issue but yarn errors on the install. This seems counter-intuitive that npm can figure it out but yarn is perplexed.

ckee83 commented 6 years ago

Uf! Sorry all, classic case of fixing a problem and forgetting all about the help requests you sent out into the aether.

TL:DR The fix for me looked something like this:

# Dockerfile
FROM node:6.12-alpine

ENV app_dir /usr/src/app

RUN mkdir -p $app_dir

# This guy couldn't do it by himself
# RUN yarn

# This got me running
RUN apk add --no-cache --virtual .gyp \
  python \
  make \
  g++ \
  && yarn

CMD ["start"]

ENTRYPOINT ["yarn"]

I've only tested the above fix in alpine containers so YMMV.

@EmaGht is correct, the container was trying to build binaries and unable to find python.

@BYK Thank you for your quick response and offer to help, sorry I missed it. >_<

kuncevic commented 6 years ago

Removed the yarn.lock then after yarn install all looking good. Seems like it some package was being buggy in my case.

haejinjo commented 6 years ago

@kuncevic Is removing yarn.lock analogous to removing package-lock.json with npm? I only see a package.json and a yarn.lock in my directory and I'm wondering if I'm still encountering these errors because I haven't removed them on top of removing node_modules.

damusnet commented 6 years ago

@haejinjo yes, they are the same, and it will lead to upgrading all minor dependencies, which is probably not what you want to do.

FYI, this issue happened to me as well, and the solution in my case was to run yarn cache clean but also to remove some other global folder, which I can't quite remember.