Skip to content

node-sass problem when ng new on environment without githubaccess #8661

@SlingingCode

Description

@SlingingCode

Versions

Output from: `ng --version`.
Angular CLI: 1.5.4
Node: 8.9.1
OS: win32 ia32
Angular: 5.0.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.4
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.21
@angular-devkit/schematics: 0.0.37
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.4
@schematics/angular: 0.1.7
typescript: 2.4.2
webpack: 3.8.1

npm -v
5.5.1

Windows 8

Repro steps

  • Step 1
    pointed to proget
    npm config set registry pointingToOurProget

  • Step 2
    installed cli
    npm install @angular/cli

  • Step 3
    ng new testname -st -sg --minimal
    (flags unimportant)

  • Step 4
    npm install
    (in folder testname)

Observed behavior

PS C:\testasig\sasstest28> npm install

> node-sass@4.7.2 install C:\testasig\sasstest28\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.7.2/win32-ia32-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.7.2/win32-ia32-57_binding.node":

connect ETIMEDOUT 192.30.253.112:443

Timed out whilst downloading the prebuilt binary

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> node-sass@4.7.2 postinstall C:\testasig\sasstest28\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files (x86)\nodejs\node.exe C:\testasig\sasstest28\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files (x86)\\nodejs\\node.exe',
gyp verb cli   'C:\\testasig\\sasstest28\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@8.9.1 | win32 | ia32
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\testasig\sasstest28\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\testasig\sasstest28\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\testasig\sasstest28\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\testasig\sasstest28\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\testasig\sasstest28\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\testasig\sasstest28\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\testasig\sasstest28\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\testasig\sasstest28\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\testasig\sasstest28\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\testasig\sasstest28\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\testasig\sasstest28\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\testasig\sasstest28\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed   stack: 'Error: not found: python2\n    at getNotFoundError (C:\\testasig\\sasstest28\\node_modules\\which\\which.js:13:12)\n    at F (C:\\testasig\\sasstest28\\node_modules\\which\\which.js:68:19)\n    at E (C:\\testasig\\sasstest28\\node_modules\\which\\which.js:80:29)\n    at C:\\testasig\\sasstest28\\node_modules\\which\\which.js:89:16\n    at C:\\testasig\\sasstest28\\node_modules\\isexe\\index.js:42:5\n    at C:\\testasig\\sasstest28\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\testasig\sasstest28\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\testasig\sasstest28\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\testasig\sasstest28\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\testasig\sasstest28\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\testasig\sasstest28\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\testasig\sasstest28\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed  python { Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\testasig\sasstest28\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\testasig\sasstest28\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\testasig\sasstest28\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\testasig\sasstest28\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\testasig\sasstest28\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\testasig\sasstest28\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed   stack: 'Error: not found: python\n    at getNotFoundError (C:\\testasig\\sasstest28\\node_modules\\which\\which.js:13:12)\n    at F (C:\\testasig\\sasstest28\\node_modules\\which\\which.js:68:19)\n    at E (C:\\testasig\\sasstest28\\node_modules\\which\\which.js:80:29)\n    at C:\\testasig\\sasstest28\\node_modules\\which\\which.js:89:16\n    at C:\\testasig\\sasstest28\\node_modules\\isexe\\index.js:42:5\n    at C:\\testasig\\sasstest28\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp verb check python version `C:\Python27\python.exe -c "import platform; print(platform.python_version());"` returned: "2.7.14\r\n"
gyp verb get node dir no --target version specified, falling back to host node version: 8.9.1
gyp verb command install [ '8.9.1' ]
gyp verb install input version string "8.9.1"
gyp verb install installing version: 8.9.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.9.1
gyp verb ensuring nodedir is created C:\Users\sjomar02\.node-gyp\8.9.1
gyp verb created nodedir C:\Users\sjomar02\.node-gyp\8.9.1
gyp http GET https://nodejs.org/download/release/v8.9.1/node-v8.9.1-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '8.9.1' ]
gyp verb remove using node-gyp dir: C:\Users\sjomar02\.node-gyp
gyp verb remove removing target version: 8.9.1
gyp verb remove removing development files for version: 8.9.1
gyp ERR! configure error
gyp ERR! stack Error: connect ETIMEDOUT 104.20.23.46:443
gyp ERR! stack     at Object._errnoException (util.js:1024:11)
gyp ERR! stack     at _exceptionWithHostPort (util.js:1046:20)
gyp ERR! stack     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\testasig\\sasstest28\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\testasig\sasstest28\node_modules\node-sass
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 (node_modules\node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 postinstall: `node scripts/build.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

added 45 packages in 58.53s
PS C:\testasig\sasstest28>

Desired behavior

What would like to see implemented?

What is the usecase?

Environment where github access is denied.
Have pointed registry to proget, and all packages seams to be loaded ok through proget, except for node-sass that is loaded by Angular CLI as an optional dependency.
It tries to hit github to get the package (even if we specify style=css) when we do ng new. 


What did you expect to see?
Not hitting github (hitting proget that we pointed to with npm config registry?)
I did not even expect an optional dependency be downloaded at all if not used?


### Mention any other details that might be useful (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions