node-sass problem when ng new on environment without githubaccess
See original GitHub issueVersions
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)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Node Sass does not yet support your current environment
Yes the problem was with current version of node that has some bugs, so installing LTS version will fix the issues than you...
Read more >Why are my builds failing with a node-sass error? - Heroku Help
Your builds are failing with the following error message: Node Sass could not find a binding for your current environment: Linux 64-bit ...
Read more >node-sass - npm
Latest version: 8.0.0, last published: 2 months ago. Start using node-sass in your project by running `npm i node-sass`.
Read more >node sass does not yet support your current environment
I'm using Nodejs version 8.9.4 and the npm install command works well; however, when I run ng serve command, I have this message:....
Read more >Angular 7 npm install error due to node-sass, node-gyp ...
Install Python2* if not installed already. · Install Windows Build Tools***. · Uninstall the problem package: build-angular. · Uninstall node-sass.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The
node-sass
dependency is optional but not because projects can not be using it. It’s optional because installing it can fail, like in your case. We don’t have fractional CLI packages supporting only some functionality, all support is included in the install.So the behaviour you’re seeing is expected. In your environment
node-sass
cannot be downloaded so it’s ignored and install still finishes successfully. You can tellnpm
to not install optional packages by using the--no-optional
flag though.Regarding the URL that
node-sass
uses to download the binary, you can try setting theHTTP_PROXY
like the error message says, or try using the binary config parameters in thenode-sass
repo: https://github.com/sass/node-sass#binary-configuration-parametersI got same issue and have tried using the --no-optional.
But I got error when run “ng build”. I assume it because I use sass.
So I uninstall Angular CLI and install node-gyp and windows-build-tools globally.
npm install -g node-gyp
npm install –g –production windows-build-tools
Then re-install Angular CLI . It works perfectly.